parse: allow test names like test00 and 00 simutaneaously

parent e0d1afa6
...@@ -10,6 +10,7 @@ tokens = ( ...@@ -10,6 +10,7 @@ tokens = (
'LPAREN', 'LPAREN',
'RPAREN', 'RPAREN',
'DASH', 'DASH',
'TEST',
) )
t_NUMBER = r'[0-9]+' t_NUMBER = r'[0-9]+'
...@@ -17,6 +18,7 @@ t_REPEAT = r'repeat' ...@@ -17,6 +18,7 @@ t_REPEAT = r'repeat'
t_LPAREN = r'\(' t_LPAREN = r'\('
t_RPAREN = r'\)' t_RPAREN = r'\)'
t_DASH = r'-' t_DASH = r'-'
t_TEST = r'test'
t_ignore = ' \t' t_ignore = ' \t'
...@@ -47,8 +49,9 @@ def p_batch_range(p): ...@@ -47,8 +49,9 @@ def p_batch_range(p):
p[0] = [ 'range', p[1], p[3] ] p[0] = [ 'range', p[1], p[3] ]
def p_tst(p): def p_tst(p):
'tst : NUMBER' '''tst : NUMBER
p[0] = p[1] | TEST NUMBER'''
p[0] = p[len(p)-1]
def p_error(p): def p_error(p):
print 'syntax error!' print 'syntax error!'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment