diff options
| author | s-ol <s-ol@users.noreply.github.com> | 2020-01-31 15:05:06 +0000 |
|---|---|---|
| committer | s-ol <s-ol@users.noreply.github.com> | 2020-01-31 15:05:06 +0000 |
| commit | d6d294cabcd01ec7060953e692b3e8c119bd04ec (patch) | |
| tree | 5cc57f39d418bb965ad590d720649ca90a9be81f /spec | |
| parent | comments, actual working things (diff) | |
| download | alive-d6d294cabcd01ec7060953e692b3e8c119bd04ec.tar.gz alive-d6d294cabcd01ec7060953e692b3e8c119bd04ec.zip | |
nested parens in comments
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 |
