1 -- Copyright 2006-2015 Mitchell mitchell.att.foicica.com. See LICENSE.
4 local l
= require('lexer')
5 local token
, word_match
= l
.token
, l
.word_match
6 local P
, R
, S
= lpeg
.P
, lpeg
.R
, lpeg
.S
8 local M
= {_NAME
= 'props'}
11 local ws
= token(l
.WHITESPACE
, l
.space^
1)
14 local comment
= token(l
.COMMENT
, '#' * l
.nonnewline^
0)
17 local equals
= token(l
.OPERATOR
, '=')
20 local sq_str
= l
.delimited_range("'")
21 local dq_str
= l
.delimited_range('"')
22 local string = token(l
.STRING
, sq_str
+ dq_str
)
25 local variable
= token(l
.VARIABLE
, '$(' * (l
.any
- ')')^
1 * ')')
28 local xdigit
= l
.xdigit
29 local color
= token('color', '#' * xdigit
* xdigit
* xdigit
* xdigit
* xdigit
*
38 {'variable', variable
},
42 color
= l
.STYLE_NUMBER