Commit Graph

5 Commits (bf545869aa4bf2b8539a953f397e20a9728102d4)

Author SHA1 Message Date
Gears bf545869aa
Use constructor names for unqualified imported values (#120) 2025-05-17 07:50:31 +07:00
Michael Davis ae4b58b85f
Allow discarding module imports with underscore
Gleam 0.23.3 allows discarding imported modules with the discard syntax.
This needs a small change in tree-sitter-gleam to accept discard nodes
in the import's 'as' field.
2023-11-07 13:07:02 +07:00
Michael Davis e566689d6d
Parse unqualified type imports with 'type Typename' (#73) 2023-10-29 11:11:53 +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
Jonathan Arnett 0b8f7bcae9 Move corpus/ under test/ 2022-02-24 18:48:31 +07:00