diff options
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/parsing_spec.moon | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/parsing_spec.moon b/spec/parsing_spec.moon index f1c85f2..5af12ba 100644 --- a/spec/parsing_spec.moon +++ b/spec/parsing_spec.moon @@ -1,4 +1,4 @@ -import space, atom, expr, explist, sexpr, nexpr, program from require 'parsing' +import space, atom, expr, explist, sexpr, nexpr, program, comment from require 'parsing' describe 'atom parsing', -> test 'symbols', -> @@ -104,6 +104,19 @@ describe 'sexpr', -> assert.is.equal 42, node.tag assert.is.equal str, node\stringify! +describe 'comments', -> + comment = comment / 1 + test 'simple parsing', -> + str = '#(this is a comment)' + assert.is.equal str, comment\match str + + test 'nested parsing', -> + str = '#(this is a comment (with nested parenthesis))' + assert.is.equal str, comment\match str + + str = '#(this is a comment #(with nested comments))' + assert.is.equal str, comment\match str + describe 'resynthesis', -> test 'mixed parsing', -> str = '( 3 ok-yes |
