diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-08-13 14:55:49 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-08-27 11:29:45 -0700 |
commit | 9951ad78c80e144c166a7d476cad7ffdf84332a9 (patch) | |
tree | 9f5498a9a3c23b62dc928288e72081e99f958f46 /src/sexpr/parser.py | |
parent | 749fec734c4583153fb2dbc80f1d21db2c2ab457 (diff) | |
download | tmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.tar.gz tmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.tar.bz2 tmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.tar.xz tmwa-9951ad78c80e144c166a7d476cad7ffdf84332a9.zip |
Debug debugging
Diffstat (limited to 'src/sexpr/parser.py')
-rw-r--r-- | src/sexpr/parser.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/sexpr/parser.py b/src/sexpr/parser.py index 201f457..885c63c 100644 --- a/src/sexpr/parser.py +++ b/src/sexpr/parser.py @@ -1,6 +1,4 @@ class SExpr(object): - ''' print a SExpr - ''' __slots__ = ('_value') name = 'tmwa::sexpr::SExpr' enabled = True @@ -23,3 +21,19 @@ class SExpr(object): if t == 3: yield '(token)', v['_str'] yield '_span', v['_span'] + + test_extra = ''' + #include "../strings/fwd.hpp" + using tmwa::operator "" _s; + ''' + + tests = [ + ('tmwa::sexpr::SExpr(); value._type = tmwa::sexpr::LIST; value._list = {tmwa::sexpr::SExpr(), tmwa::sexpr::SExpr()}', + '{(list) = std::vector of length 2, capacity 2 = {{(list) = std::vector of length 0, capacity 0, _span = {begin = {<tmwa::io::Line> = {text = "", filename = "", line = 0, column = 0}, <No data fields>}, end = {<tmwa::io::Line> = {text = "", filename = "", line = 0, column = 0}, <No data fields>}}}, {(list) = std::vector of length 0, capacity 0, _span = {begin = {<tmwa::io::Line> = {text = "", filename = "", line = 0, column = 0}, <No data fields>}, end = {<tmwa::io::Line> = {text = "", filename = "", line = 0, column = 0}, <No data fields>}}}}, _span = {begin = {<tmwa::io::Line> = {text = "", filename = "", line = 0, column = 0}, <No data fields>}, end = {<tmwa::io::Line> = {text = "", filename = "", line = 0, column = 0}, <No data fields>}}}'), + ('tmwa::sexpr::SExpr(); value._type = tmwa::sexpr::INT; value._int = 42', + '{(int) = 42, _span = {begin = {<tmwa::io::Line> = {text = "", filename = "", line = 0, column = 0}, <No data fields>}, end = {<tmwa::io::Line> = {text = "", filename = "", line = 0, column = 0}, <No data fields>}}}'), + ('tmwa::sexpr::SExpr(); value._type = tmwa::sexpr::STRING; value._str = "Hello"_s', + '{(str) = "Hello", _span = {begin = {<tmwa::io::Line> = {text = "", filename = "", line = 0, column = 0}, <No data fields>}, end = {<tmwa::io::Line> = {text = "", filename = "", line = 0, column = 0}, <No data fields>}}}'), + ('tmwa::sexpr::SExpr(); value._type = tmwa::sexpr::TOKEN; value._str = "Hello"_s', + '{(token) = "Hello", _span = {begin = {<tmwa::io::Line> = {text = "", filename = "", line = 0, column = 0}, <No data fields>}, end = {<tmwa::io::Line> = {text = "", filename = "", line = 0, column = 0}, <No data fields>}}}'), + ] |