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

handle corner case of syntax in cond #15

Merged
merged 2 commits into from
Feb 18, 2021
Merged

handle corner case of syntax in cond #15

merged 2 commits into from
Feb 18, 2021

Conversation

tiye
Copy link
Member

@tiye tiye commented Feb 17, 2021

No description provided.

@tiye tiye requested a review from a team February 17, 2021 09:44
@tiye
Copy link
Member Author

tiye commented Feb 17, 2021

经过本次修改, $ 语法也调整了. 原先处理 ,$ 这两个特殊语法的代码是用单纯 List 操作的函数去递归实现的, 现在对应函数去掉了, 相关逻辑直接在循环当中实现. 好处是更容易模仿人类布局的习惯, 因为状态比较容易获取到, 而且性能应该是提高的毕竟减少了两次递归, 坏处是中间存在 bug 的话也更难找了, 就现在的代码来说已经变得更加复杂了.

@tiye
Copy link
Member Author

tiye commented Feb 18, 2021

根据实际使用的结果 https://github.com/calcit-lang/lilac/pull/9/files 生成的文件当中, compact.cirru 实际的行数会增多, 原因是有些之前包含 $ 的 simple expr 在新的解释当中不再认为是 simple expr 了, 总体字符数由于缩进还是会增加的, 的对性能可能有某些影响, 要看运行环境对 string 的优化了.

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.

2 participants