Skip to content

bnf需要支持一类特殊的符号,是对受限token的支持,对之后出现的token的描述。 #15

Description

@acodercc

https://github.com/takumi4ichi/caliburn 项目的分号补全,以及除法TOKEN和正则TOKEN的区分,以及lookheadno(FUNCTION, {)而增加该功能需求。

比如

program ->
  line;
line ->
  NUMBER ';'
| IDENT [noLineTerminator] '++';
;

可以看出,这个接受以下句子:

123;
abc++;

abc是一个IDENT,但是和下一个token_++_之间,出现了[noLineTerminator],所以执行一些特殊的语法动作,来对自动插入分号的需求进行支持。

该功能从 @jsinjs 中学习。
[div]
[noLineTerminator]
[lookaheadno{{,function}]

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions