Add ParseError: a dependent statement may not be a declaration
This commit is contained in:
parent
ec355abb20
commit
252e8ad829
@ -188,6 +188,15 @@ ParseReturn parse_statement(vector<Token> tokens) {
|
|||||||
Node expr = ret.node;
|
Node expr = ret.node;
|
||||||
|
|
||||||
ret = parse_instruction(tokens); // Instruction1
|
ret = parse_instruction(tokens); // Instruction1
|
||||||
|
|
||||||
|
if (holds_alternative<InnerNode>(ret.node) &&
|
||||||
|
( get<InnerNode>(ret.node).type == NodeType::AssignedDeclaration ||
|
||||||
|
get<InnerNode>(ret.node).type == NodeType::Declaration ) )
|
||||||
|
throw SyntaxError(
|
||||||
|
"a dependent statement may not be a declaration",
|
||||||
|
pos=tokens.back().pos
|
||||||
|
);
|
||||||
|
|
||||||
tokens = ret.tokens;
|
tokens = ret.tokens;
|
||||||
Node instruction1 = ret.node;
|
Node instruction1 = ret.node;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user