summaryrefslogtreecommitdiff
path: root/test/colm.d/balance3.lm
blob: aae049b7af50ee13b8705020a37e2720f9a67474 (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
30
31
32
lex
	token id /[a-z]+/
	ignore /[ \t\n]/

	literal `;

	token PLUS /'+'/ {
		input->pull( match_length )

		parse M: main "there is more;"
		input->push( M )
		input->push( "; " )
	}
end

def stmt
	[id* `;]

def main
	[stmt+]

parse M: main [stdin]

print
	"parsed tree
	[M]
	"<-
##### IN #####
a b + c d; @
##### EXP #####
parsed tree
NIL<-