mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-07 10:21:31 +00:00
DIRECTOR: LINGO: Reimplement scummvmAssertError
This commit is contained in:
parent
35c103de10
commit
884db621b4
@ -44,6 +44,7 @@ struct RepeatWithToNode;
|
||||
struct NextRepeatNode;
|
||||
struct ExitRepeatNode;
|
||||
struct ExitNode;
|
||||
struct AssertErrorNode;
|
||||
struct IntNode;
|
||||
struct FloatNode;
|
||||
struct SymbolNode;
|
||||
@ -91,6 +92,7 @@ enum NodeType {
|
||||
kNextRepeatNode,
|
||||
kExitRepeatNode,
|
||||
kExitNode,
|
||||
kAssertErrorNode,
|
||||
kIntNode,
|
||||
kFloatNode,
|
||||
kSymbolNode,
|
||||
@ -132,6 +134,7 @@ public:
|
||||
virtual void visitNextRepeatNode(NextRepeatNode *node) = 0;
|
||||
virtual void visitExitRepeatNode(ExitRepeatNode *node) = 0;
|
||||
virtual void visitExitNode(ExitNode *node) = 0;
|
||||
virtual void visitAssertErrorNode(AssertErrorNode *node) = 0;
|
||||
virtual void visitIntNode(IntNode *node) = 0;
|
||||
virtual void visitFloatNode(FloatNode *node) = 0;
|
||||
virtual void visitSymbolNode(SymbolNode *node) = 0;
|
||||
@ -473,6 +476,20 @@ struct ExitNode : StmtNode {
|
||||
}
|
||||
};
|
||||
|
||||
/* AssertErrorNode */
|
||||
|
||||
struct AssertErrorNode : StmtNode {
|
||||
Node *stmt;
|
||||
|
||||
AssertErrorNode(Node *stmtIn) : StmtNode(kAssertErrorNode), stmt(stmtIn) {}
|
||||
virtual ~AssertErrorNode() {
|
||||
delete stmt;
|
||||
}
|
||||
virtual void accept(NodeVisitor *visitor) {
|
||||
visitor->visitAssertErrorNode(this);
|
||||
}
|
||||
};
|
||||
|
||||
/* IntNode */
|
||||
|
||||
struct IntNode : ExprNode {
|
||||
|
@ -723,6 +723,14 @@ void LingoCompiler::visitExitNode(ExitNode *node) {
|
||||
code1(LC::c_procret);
|
||||
}
|
||||
|
||||
/* AssertErrorNode */
|
||||
|
||||
void LingoCompiler::visitAssertErrorNode(AssertErrorNode *node) {
|
||||
code1(LC::c_asserterror);
|
||||
compile(node->stmt);
|
||||
code1(LC::c_asserterrordone);
|
||||
}
|
||||
|
||||
/* IntNode */
|
||||
|
||||
void LingoCompiler::visitIntNode(IntNode *node) {
|
||||
|
@ -95,6 +95,7 @@ public:
|
||||
virtual void visitNextRepeatNode(NextRepeatNode *node);
|
||||
virtual void visitExitRepeatNode(ExitRepeatNode *node);
|
||||
virtual void visitExitNode(ExitNode *node);
|
||||
virtual void visitAssertErrorNode(AssertErrorNode *node);
|
||||
virtual void visitIntNode(IntNode *node);
|
||||
virtual void visitFloatNode(FloatNode *node);
|
||||
virtual void visitSymbolNode(SymbolNode *node);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -377,6 +377,7 @@ proc: ID cmdargs '\n' { $$ = new CmdNode($ID, $cmdargs); }
|
||||
| tNEXT tREPEAT '\n' { $$ = new NextRepeatNode(); }
|
||||
| tEXIT tREPEAT '\n' { $$ = new ExitRepeatNode(); }
|
||||
| tEXIT '\n' { $$ = new ExitNode(); }
|
||||
| tASSERTERROR stmtoneliner { $$ = new AssertErrorNode($stmtoneliner); }
|
||||
;
|
||||
|
||||
cmdargs: /* empty */ {
|
||||
|
Loading…
Reference in New Issue
Block a user