Skip to content

Commit

Permalink
FEAT: improves lexer events returned value description (relates to re…
Browse files Browse the repository at this point in the history
…d#5444)
  • Loading branch information
dockimbel committed Jan 18, 2024
1 parent 7ccbe61 commit 16f61b9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions en/lexer.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,15 @@ The meaning of some arguments and return value __depends__ on the event. The fol
|===
|Event | Type | Token | Return Value | Description
|`prescan`| word! datatype!| pair!| `true`: scan +
`false`: drop| When a Red token has been recognized.
`false`: ignore| When a Red token has been recognized.
|`scan`| word! datatype!| pair!| `true`: load +
`false`: drop| When a Red token type has been accurately recognized.
`false`: ignore| When a Red token type has been accurately recognized.
|`load`| datatype!| <value>| `true`: store +
`false`: drop| When a Red token has been converted to a Red value.
|`open`| datatype!| pair!| `true`: open +
`false`: drop| When a new block!, paren!, path!, map! or multiline string! is opened.
`false`: ignore| When a new block!, paren!, path!, map! or multiline string! is opened.
|`close`| datatype!| pair!| `true`: close +
`false`: drop| When a new block!, paren!, path!, map! or multiline string! is closed.
`false`: ignore| When a new block!, paren!, path!, map! or multiline string! is closed.
|`error`| datatype!| pair!| `true`: throw +
`false`: ignore| When a syntax error occurs.
|===
Expand Down Expand Up @@ -242,7 +242,7 @@ Notes:

* If `false` is returned on a `scan` event, the corresponding `load` event will be skipped.

* If an `open` event is dropped, the corresponding `close` event should also be dropped.
* If an `open` event is ignored, the corresponding `close` event should also be ignored. Both events must return the same logical value or an error will be raised.


See examples at https://github.com/red/code/tree/master/Scripts/lexer

0 comments on commit 16f61b9

Please sign in to comment.