summaryrefslogtreecommitdiff
path: root/test/construct1.lm
blob: ee9b36b399dd064cef6fb0d19e3afb34c17ef791 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
##### LM #####
rl ident_pattern /[a-zA-Z_][a-zA-Z_0-9]*/
rl number_pattern /[0-9]+/

lex
	ignore /[ \t\n]+/
	token id /ident_pattern/
	token number /number_pattern/
end

def four_ids
	[id id id id]

Constructed: four_ids = construct four_ids "a  b  c  d"
print_xml( Constructed )
print( '\n' )

##### EXP #####
<four_ids><id>a</id><id>b</id><id>c</id><id>d</id></four_ids>