Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@QuarkGluonPlasma
Copy link
Contributor

@QuarkGluonPlasma QuarkGluonPlasma commented Mar 16, 2021

lexer重构,加上了状态的tag,通过tag驱动流转,把tag部分拆分成了3个状态。

本来是为了提升可读性,结果意外的提升了性能,15%左右。

加入了context,之前叫state。在状态流转的过程中传递context

@QuarkGluonPlasma QuarkGluonPlasma changed the title lexer重构,改为状态tag驱动的经典状态及 lexer重构,改为状态tag驱动的经典状态机 Mar 16, 2021
@yisar
Copy link
Contributor

yisar commented Mar 16, 2021

看上去似乎也看不出哪里性能有差距
我怀疑我写的哪里有可能比较慢,明天研究下

NEXT: Symbol()
}

const stateHandlerMap = [
Copy link

Choose a reason for hiding this comment

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

new Map直接接受这个二维数据就好了

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.

3 participants