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

New lexer #25

Open
wants to merge 10 commits into
base: docs
Choose a base branch
from
Open

New lexer #25

wants to merge 10 commits into from

Conversation

shigma
Copy link
Collaborator

@shigma shigma commented Jul 3, 2018

一个新的 Lexer,利用状态机实现。

优势:

  1. 性能大幅提升,渲染速度比过去快 2 倍以上。
  2. 代码量减少,匹配和渲染进行了整合,与状态机实现分离。

劣势:

  1. 部分状态匹配与预期不符(list,table 和 paragraph)
  2. 文档“小节线”打开时会卡死(原因不明,且仅有这一处)

希望大家能帮忙解决这些问题。

@shigma shigma added the 优化 对现有特性的优化 label Jul 3, 2018
@shigma shigma requested review from jjyyxx and NN708 and removed request for NN708 July 3, 2018 10:59
Copy link
Member

@jjyyxx jjyyxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

首先,感谢这一项及时的工作!完全基于正则表达式的匹配在tmd的section的匹配上遇到一定困难,状态机很有希望有效解决这一问题。
但在合并之前,应当解决劣势中1、2所提及的问题,并进行充分的测试。该部分更改基本全部处于lib/tmdoc中,对其他部分的继续开发不构成阻碍。
希望@shigma对状态机及rules等引入的概念提供一定的注释,进行说明,方便大家共同参与解决问题,并进一步改进。
pr保留,并在new-lexer分支上进一步调试,在解决以上两个问题后进行合并。

# Conflicts:
#	build/index.js
@jjyyxx
Copy link
Member

jjyyxx commented Jul 3, 2018

现在new-lexer分支可以进行调试了,从我的初步测试来看,除了小节线,,API的Setting、Ammonia的overview都出现了卡死的状况,亟待解决。

@shigma shigma added bug 程序表现出与预期不符的现象 文档相关 与文档显示相关的问题 labels Jul 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 程序表现出与预期不符的现象 优化 对现有特性的优化 文档相关 与文档显示相关的问题
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants