summaryrefslogtreecommitdiff
path: root/tests/snippets/peg/test_operators.txt
blob: b901c818ef973f3881582d6469482fae1cc040b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# 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

'rule'        Name.Class
':'           Operator
' '           Text
"'a'"         Literal.String.Single
' '           Text
'~'           Operator
' '           Text
"'b'"         Literal.String.Single
'\n'          Text