Added check against local builtins
This commit is contained in:
parent
f3fc69c870
commit
6fe9de3af5
2 changed files with 11 additions and 0 deletions
|
@ -16,6 +16,9 @@ namespace arookas {
|
||||||
public override void Compile(sunCompiler compiler) {
|
public override void Compile(sunCompiler compiler) {
|
||||||
var symbol = compiler.Context.DeclareBuiltin(this);
|
var symbol = compiler.Context.DeclareBuiltin(this);
|
||||||
symbol.Modifiers = Modifiers;
|
symbol.Modifiers = Modifiers;
|
||||||
|
if ((symbol.Modifiers & sunSymbolModifiers.Local) != 0) {
|
||||||
|
throw new sunInvalidModifierException(this[0]); // local builtins are not supported
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -251,4 +251,12 @@ namespace arookas {
|
||||||
public sunContinueException(sunContinue node)
|
public sunContinueException(sunContinue node)
|
||||||
: base(node) { }
|
: base(node) { }
|
||||||
}
|
}
|
||||||
|
class sunInvalidModifierException : sunNodeException<sunNode> {
|
||||||
|
public override string Message {
|
||||||
|
get { return "Unsupported modifier in modifier list."; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public sunInvalidModifierException(sunNode node)
|
||||||
|
: base(node) { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue