Skip to content

Commit

Permalink
docs: add clarification for longer_alt chaining
Browse files Browse the repository at this point in the history
fixes #1334
  • Loading branch information
bd82 committed Feb 25, 2021
1 parent 7d2bb11 commit 5a50819
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/chevrotain/api.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1535,6 +1535,8 @@ export interface ITokenConfig {
* This feature can be useful when two Token Types have common prefixes which
* cannot be resolved (only) by the ordering of the Tokens in the lexer definition.
*
* - Note that the `longer_alt` capability is **cannot be chained**, only a single longer_alt will be checked for a specific Token.
*
* For example see: https://github.com/chevrotain/chevrotain/tree/master/examples/lexer/keywords_vs_identifiers
* For resolving the keywords vs Identifier ambiguity.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,7 @@ const ClassKeyword = createToken({
})
```

Note that the `longer_alt` capability is **cannot be chained**, only a single longer_alt will be checked for a specific Token.

See [executable example](https://github.com/chevrotain/chevrotain/tree/master/examples/lexer/keywords_vs_identifiers)
for further details.

0 comments on commit 5a50819

Please sign in to comment.