添加对while-do语句的支持 (#77)
Co-authored-by: jackfiled <xcrenchangjun@outlook.com> Reviewed-on: PostGuard/Canon#77 Co-authored-by: ichirinko <1621543655@qq.com> Co-committed-by: ichirinko <1621543655@qq.com>
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -348,6 +348,7 @@ public static class PascalGrammar
|
||||
// | CompoundStatement
|
||||
// | if Expression then Statement ElsePart
|
||||
// | for id AssignOp Expression to Expression do Statement
|
||||
// | while Expression do Statement
|
||||
// 注意这里 read 和 write 作为普通的函数调用处理了
|
||||
// 因此下面并没有单独声明
|
||||
new NonTerminator(NonTerminatorType.Statement), [
|
||||
@@ -387,6 +388,13 @@ public static class PascalGrammar
|
||||
new NonTerminator(NonTerminatorType.Expression),
|
||||
new Terminator(KeywordType.Do),
|
||||
new NonTerminator(NonTerminatorType.Statement)
|
||||
],
|
||||
[
|
||||
// while Expression do Statement
|
||||
new Terminator(KeywordType.While),
|
||||
new NonTerminator(NonTerminatorType.Expression),
|
||||
new Terminator(KeywordType.Do),
|
||||
new NonTerminator(NonTerminatorType.Statement)
|
||||
]
|
||||
]
|
||||
},
|
||||
|
Reference in New Issue
Block a user