Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite 音韻地位.屬於 #21

Merged
merged 6 commits into from
Mar 17, 2022
Merged

Rewrite 音韻地位.屬於 #21

merged 6 commits into from
Mar 17, 2022

Conversation

syimyuzya
Copy link
Member

@syimyuzya syimyuzya commented Mar 15, 2022

Edit:

😂😂😂 處理 parser 問題結果把 .屬於 給直接重寫了

現在是分成三步:

  1. 詞法分析,同時把非惰性的值全求出來
  2. 句法分析,手寫的 LL(1) 遞歸下降
  3. 求值

(Original)

Issues with invalid expressions:

(地位 is 幫三凡入)

  • 地位.屬於`三等 且 ()` should throw, not eval that () to true.
  • 地位.屬於`或 一等` should throw, not eval to true
  • 地位.屬於`且 三等` & 地位.屬於`三等 且 (或 一等)` should also throw

Including some new cases that are currently not well handled.
@syimyuzya syimyuzya self-assigned this Mar 15, 2022
Now with 3 stages:

1.  Lexing, eager evaluation also performed during this stage;
2.  Parsing, using hand-crafted LL(1) recursive-descent parser;
3.  Evaluation.
@syimyuzya syimyuzya changed the title Properly check invalid syntax in 音韻地位.屬於 Rewrite 音韻地位.屬於 Mar 16, 2022
@syimyuzya syimyuzya marked this pull request as ready for review March 16, 2022 06:47
@syimyuzya
Copy link
Member Author

syimyuzya commented Mar 16, 2022

好耶~

原來在 eslint 下寫不固定條件循環的正確方式是for (;;) 😂

@syimyuzya
Copy link
Member Author

syimyuzya commented Mar 16, 2022

正在拿 qieyun-examples 測這版有沒有引入什麼新的不一致行為,等測完了再合併w

Edit: 測試好了,運行完全正常~

@syimyuzya syimyuzya merged commit 1c58e17 into main Mar 17, 2022
@graphemecluster graphemecluster deleted the parser-fix branch April 25, 2022 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants