summaryrefslogtreecommitdiff
path: root/test/construct3.lm
blob: 8edb03808148c5061e28bbe5a11047418fc99141 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
##### LM #####

lex
	ignore /[ \t\n]+/
	token id /[a-z0-9]+/
	literal `, `. `* `( `)
end

def bigger [`( item* `)]

def item [id] | [bigger]

def lang [item*]

B: bigger = construct bigger "( b1 b2 )"
print( construct lang "a [B] c" '\n' )

##### EXP #####
a ( b1 b2 ) c