Commit Graph

9 Commits (d90c00d7dd53cd0aba9d5585de0c664aa94c89dd)

Author SHA1 Message Date
Michael Davis d90c00d7dd
Add test cases for panic/todo 'as' with expressions
This is newly allowed in v0.33.0 but happened to be allowed in
tree-sitter-gleam anyways.
2023-12-06 18:33:50 +07:00
Jonathan Arnett 4a3bae27c7 Add integer negation 2023-07-29 19:17:09 +07:00
Jonathan Arnett c9189c3974 Move "use" tests to "statements.txt" file 2023-07-29 19:16:42 +07:00
Michael Davis 7bfdc49a7c
Allow patterns in use expressions (#49) 2023-03-02 23:25:47 +07:00
Michael Davis 8df06b69b0
Parse 'use' expressions (#42) 2022-11-23 14:03:22 +07:00
Michael Davis e21567343e
Support v0.24 binary concatenation operator (#39) 2022-10-27 23:54:52 +07:00
Jonathan Arnett aed23b28dd
Differentiate data constructor names from type names (#28) 2022-05-24 14:37:32 +07:00
Jonathan Arnett b249843e44
Add support for v0.21.0 (aka add bang negation) (#24) 2022-05-04 14:37:31 +07:00
Michael Davis 5b9171bf0e
parse expressions outside of functions (#20)
* parse top-level expressions

This change allows the parser to return valid nodes for expressions
on the "top-level" of a document.

Here "top-level" is read as "not within a function." This is actually
invalid Gleam code: for example, you cannot write a `case/2` statement
outside of a function body. This is desirable for the tree-sitter
parser, though, because the parser will end up being used in flexible
situations, such as one-off highlights in fenced markdown blocks, e.g.:

    ```gleam
    <<code:int-size(8)-unit(2), reason:utf8>>
    ```

Which is a common usage in an editor, or on GitHub.

* remove test cases for invalid syntax
2022-03-24 16:11:57 +07:00