Commit Graph

238 Commits (1b6570df84c5429113b73e11f3451bdb42d39ee2)
 

Author SHA1 Message Date
Michael Davis 9013c64605 Rename _statement to _module_statement
This matches the naming within the compiler. This refactor is necessary
since the child commit will use the _statement rule.
2023-04-07 10:58:08 +07:00
Jonathan Arnett ae79782c00 Version 0.27.0 2023-03-03 16:33:31 +07:00
Jonathan Arnett 3c20676cdf Add highlight test for `let assert` 2023-03-03 16:30:06 +07:00
Jonathan Arnett 12e8cad3d9 Small indentation change 2023-03-03 16:27:02 +07:00
inoas 2914d3b437
add `let assert` alt impl (#50) 2023-03-03 16:24:16 +07:00
inoas 64dfeebe92 Generate parser 2023-03-03 16:38:52 +07:00
inoas d14acab7f2
add `panic` keyword / add contributing section to Readme (#46) 2023-03-03 11:38:22 +07:00
Michael Davis c72df7110b Generate parser 2023-03-03 04:26:12 +07:00
Michael Davis 7bfdc49a7c
Allow patterns in use expressions (#49) 2023-03-02 23:25:47 +07:00
Jonathan Arnett 1ef8e0f02d Version 0.26.2 2023-02-11 14:56:15 +07:00
Jonathan Arnett 5fbad66fa8 Version 0.26.1 2023-02-11 14:52:01 +07:00
Jonathan Arnett 23f8c1b891 Version 0.26.0 2023-02-11 14:50:41 +07:00
Michael Davis 4f6d900930 Generate parser 2023-02-06 16:21:43 +07:00
Michael Davis 6a99b9c73b
Parse scientific notation suffix for floats (#44) 2023-02-06 11:21:19 +07:00
Jonathan Arnett 3eb2e1783f Version 0.25.3 2022-12-30 21:47:25 +07:00
Jonathan Arnett 4a020ecfad Version 0.25.2 2022-12-30 21:46:25 +07:00
Jonathan Arnett 39bb524774 Version 0.25.1 2022-12-30 21:45:48 +07:00
Jonathan Arnett 97611918f7 v0.25.0 2022-11-28 14:55:14 +07:00
Michael Davis d6cbdf3477 Generate parser 2022-11-23 19:03:45 +07:00
Michael Davis 8df06b69b0
Parse 'use' expressions (#42) 2022-11-23 14:03:22 +07:00
Jonathan Arnett daa89f67d1 Include locals and tags queries in Rust crate 2022-10-30 23:04:08 +07:00
Jonathan Arnett ed6897904f Include scanner in Rust crate 2022-10-30 23:03:56 +07:00
Jonathan Arnett 911ea3201b Add scanner.c to binding.gyp 2022-10-30 22:31:37 +07:00
Jonathan Arnett bb44ee1d0b Version 0.24.0 2022-10-28 10:09:18 +07:00
Michael Davis d166cb9ec8 Generate parser 2022-10-28 03:55:16 +07:00
Michael Davis e21567343e
Support v0.24 binary concatenation operator (#39) 2022-10-27 23:54:52 +07:00
Jonathan Arnett 926eb0262e Version 0.23.0 2022-09-18 19:23:50 +07:00
Jonathan Arnett 81670f48fa
Add support for function constants (#37) 2022-08-22 14:53:32 +07:00
Jonathan Arnett 7bfe989c55
Allow empty function bodies (#36) 2022-08-22 14:18:48 +07:00
Jonathan Arnett 85c0753e8e Version 0.22.1 2022-06-29 21:57:03 +07:00
Jonathan Arnett 08901b401c Version 0.22.0 2022-06-29 21:57:03 +07:00
Jonathan Arnett ac8c9438f8 Add scanner.c to files to be compiled for release 2022-06-29 21:57:03 +07:00
Jonathan Arnett ed604993ba
Forbid anonymous function parameter labels (#34)
Corresponds to gleam-lang/gleam#1629
2022-06-20 13:13:52 +07:00
Michael Davis 7b7628230e
add integration test CI (#32) 2022-06-08 18:32:26 +07:00
Patrick Thomson a935608722 Ensure external_scanner_scan returns false for unrecognized tokens
I noticed that clang++ warned here: 
```
deps/tree-sitter-gleam/src/scanner.c:28:1: warning: non-void function does not return a value in all control paths
```

An explicit return fixes things up.
2022-06-08 17:32:27 +07:00
Michael Davis a2e5b69f51 Generate parser 2022-06-08 03:55:36 +07:00
Michael Davis 8bde531227
parse floats with no trailing digits (#31)
floats may have a trailing dot with no trailing digits, like in
the float stdlib module:

    pub fn absolute_value(x: Float) -> Float {
      case x >=. 0. {
        True -> x
        _ -> 0. -. x
      }
    }
2022-06-07 23:55:19 +07:00
Jonathan Arnett d7861b2a4b
Change constructor tracking to not use type (#29) 2022-05-24 15:45:09 +07:00
Jonathan Arnett aed23b28dd
Differentiate data constructor names from type names (#28) 2022-05-24 14:37:32 +07:00
Jonathan Arnett 17ed183fc8
Fix for comment-in-string bug (#27)
Nodes defined in `extras` can be expected before an node. Thus, `comment` could be expected before `escape_sequence` or `quoted_content`; aka inside of a string. Naturally, this makes no sense.

I tried wrapping `escape_sequence` and `quoted_content` in `token.immediate` to resolve the issue, but it had no effect (maybe is specific to whitespace?). Instead, I found success in largely copying [`tree-sitter-rust`'s solution of using an external scanner for string content](9a6d980afb/src/scanner.c (L27-L40)).
2022-05-23 00:17:07 +07:00
Michael Davis ec0286fd84
use `function` node as a scope rather than `function_body` (#26) 2022-05-17 16:43:45 +07:00
Jonathan Arnett 6e2e92b4ad Version 0.21.0 2022-05-04 14:41:53 +07:00
Jonathan Arnett b249843e44
Add support for v0.21.0 (aka add bang negation) (#24) 2022-05-04 14:37:31 +07:00
Jonathan Arnett a1fc486493
Try (again) to make GitHub's Linguist .gitattributes work (#23)
Our present Linguist configuration in `.gitattributes` doesn't seem to be having any effect, as can be seen when viewing this commit: 7159ce9615.

Historically we've employed [the style employed by tree-sitter-elixir](60863fc6e2/.gitattributes) ([here](4ef644a352)) to no avail. This new attempt combines usage of [the shorthand from tree-sitter-rust](0509e440ae/.gitattributes) with [the no-leading-slash style from Linguist's own documentation](https://github.com/github/linguist/blob/master/docs/overrides.md#generated-code). Hopefully it works this time 🤞
2022-03-30 12:27:14 +07:00
Michael Davis 7159ce9615 Generate parser 2022-03-24 20:12:21 +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 f8d709f772 Version 0.20.1 2022-03-11 14:39:58 +07:00
Jonathan Arnett c560cb63e9 Remove note about error case tests from README 2022-03-11 14:39:48 +07:00
Jonathan Arnett 45c5b3c57f Version 0.20.0 2022-03-11 14:25:54 +07:00
Michael Davis a89523b436 Generate parser 2022-03-11 19:16:32 +07:00