mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-13 23:12:24 +00:00
30 lines
639 B
Plaintext
30 lines
639 B
Plaintext
# see for example:
|
|
# - https://github.com/gvanrossum/pegen
|
|
# - https://nim-lang.org/docs/pegs.html
|
|
|
|
---input---
|
|
rule = 'a' | 'b'
|
|
rule: 'a' ~ 'b'
|
|
|
|
---tokens---
|
|
'rule' Name.Class
|
|
' ' Text
|
|
'=' Operator
|
|
' ' Text
|
|
"'a'" Literal.String.Single
|
|
' ' Text
|
|
'|' Operator
|
|
' ' Text
|
|
"'b'" Literal.String.Single
|
|
'\n' Text.Whitespace
|
|
|
|
'rule' Name.Class
|
|
':' Operator
|
|
' ' Text
|
|
"'a'" Literal.String.Single
|
|
' ' Text
|
|
'~' Operator
|
|
' ' Text
|
|
"'b'" Literal.String.Single
|
|
'\n' Text.Whitespace
|