Skip to content

Commit cc11a9a

Browse files
committed
(if-else) clarified way to solve conflicts
1 parent b5658f5 commit cc11a9a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

docs/lv6-if/if-else.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ Stmt
6060

6161
但是你可能会说: 这个问题都导致 parser 没法 “正常工作” 了, 编译器根本进行不到语义分析阶段, 在语法分析阶段就直接歇菜了, 那还怎么搞嘛. 其实这个问题是可以直接在语法层面解决的, 你只需对 `if/else` 的语法略加修改 (提示: 拆分), 就可以完全规避这个问题.
6262

63+
?> 你在之后的 Lv. 中还可能会遇到更多类似的语法分析冲突问题, 此时, **你需要自行思考如何解决**.
64+
6365
## 语义分析
6466

6567
无需新增内容. 记得对 `if/else` 的各部分 (条件和各分支) 进行语义分析即可.

0 commit comments

Comments
 (0)