summaryrefslogtreecommitdiff
path: root/test/colm.d/construct1.lm
blob: 44b1534f9363f4944d043d92fa58d52e3fb8e15b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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>