From 26ee2483b5d6c50095d8f8a6ab2be518d3317aac Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Sun, 23 Dec 2012 17:19:26 +0200 Subject: [PATCH] Detect brackets. --- builder.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/builder.py b/builder.py index ae39d9800..8e0ddd775 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')