diff --git a/ssc/ast/nodes.functions.cs b/ssc/ast/nodes.functions.cs index ad06105..be78dfb 100644 --- a/ssc/ast/nodes.functions.cs +++ b/ssc/ast/nodes.functions.cs @@ -16,6 +16,9 @@ namespace arookas { public override void Compile(sunCompiler compiler) { var symbol = compiler.Context.DeclareBuiltin(this); symbol.Modifiers = Modifiers; + if ((symbol.Modifiers & sunSymbolModifiers.Local) != 0) { + throw new sunInvalidModifierException(this[0]); // local builtins are not supported + } } } diff --git a/ssc/exceptions.cs b/ssc/exceptions.cs index 3c76c69..26b004e 100644 --- a/ssc/exceptions.cs +++ b/ssc/exceptions.cs @@ -251,4 +251,12 @@ namespace arookas { public sunContinueException(sunContinue node) : base(node) { } } + class sunInvalidModifierException : sunNodeException { + public override string Message { + get { return "Unsupported modifier in modifier list."; } + } + + public sunInvalidModifierException(sunNode node) + : base(node) { } + } }