diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2014-03-09 20:35:18 +0200 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2014-03-09 20:35:18 +0200 |
commit | 325181cc7b2252a57cba104d179a1306722dd636 (patch) | |
tree | 069d460830b73093b23812270bcedc8b7dd3a8ea /mparser.py | |
parent | d1dfb5f5125d65ccbf283371fcac77a1c6de975d (diff) | |
download | meson-325181cc7b2252a57cba104d179a1306722dd636.zip meson-325181cc7b2252a57cba104d179a1306722dd636.tar.gz meson-325181cc7b2252a57cba104d179a1306722dd636.tar.bz2 |
A code block can be empty.
Diffstat (limited to 'mparser.py')
-rw-r--r-- | mparser.py | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -118,16 +118,14 @@ def p_codeblock(t): cb = t[3] cb.prepend(t[1]) t[0] = cb - + def p_codeblock_emptyline(t): 'codeblock : EOL codeblock' t[0] = t[2] -def p_codeblock_last(t): - 'codeblock : statement EOL' - cb = nodes.CodeBlock(t[1].lineno()) - cb.prepend(t[1]) - t[0] = cb +def p_codeblock_empty(t): + 'codeblock : ' + t[0] = nodes.CodeBlock(-1) def p_expression_atom(t): 'expression : ATOM' |