summaryrefslogtreecommitdiff
path: root/test/reparse.lm
blob: 907ca6a5baf0c3b6c82acdedb3c30a889b4f8330 (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
##### LM #####
lex
	ignore /space+/
	literal `* `( `)
	token id /[a-zA-Z_]+/
end

def item 
	[id]
|	[`( item* `)]

def start 
	[item*]

parse Input: item*[ stdin ]

S: start = cons start[ Input ]

parse Again: start[ %Input ]

print( Again )

##### IN #####
a b c ( chocolate fudge ) d e
##### EXP #####
a b c ( chocolate fudge ) d e