aboutsummaryrefslogtreecommitdiff
path: root/builder.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2012-12-23 17:19:26 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2012-12-23 17:19:26 +0200
commit26ee2483b5d6c50095d8f8a6ab2be518d3317aac (patch)
tree83910d8f1fe0b693782e6c4abdb9af589e7f2e69 /builder.py
parentaf7c9dd6e0941bbc46b553fb2ac37e117b4b06c2 (diff)
downloadmeson-26ee2483b5d6c50095d8f8a6ab2be518d3317aac.zip
meson-26ee2483b5d6c50095d8f8a6ab2be518d3317aac.tar.gz
meson-26ee2483b5d6c50095d8f8a6ab2be518d3317aac.tar.bz2
Detect brackets.
Diffstat (limited to 'builder.py')
-rwxr-xr-xbuilder.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/builder.py b/builder.py
index ae39d98..8e0ddd7 100755
--- a/builder.py
+++ b/builder.py
@@ -19,6 +19,8 @@ import ply.yacc as yacc
tokens = ['LPAREN',
'RPAREN',
+ 'LBRACKET',
+ 'RBRACKET',
'VARIABLE',
'COMMENT',
'EQUALS',
@@ -32,6 +34,8 @@ tokens = ['LPAREN',
t_EQUALS = '='
t_LPAREN = '\('
t_RPAREN = '\)'
+t_LBRACKET = '\['
+t_RBRACKET = '\]'
t_VARIABLE = '[a-zA-Z][_0-9a-zA-Z]*'
t_COMMENT = '\#[^\n]*'
t_COMMA = ','
@@ -48,6 +52,7 @@ def t_error(t):
def test_lexer():
s = """hello = (something) # this = (that)
+ two = ['file1', 'file2']
function(h)
obj.method(lll, \\
'string')