Commit Graph

235 Commits (05a162d560b5eec1a4b28d8cc98940f592bbb06b)
 

Author SHA1 Message Date
Michael Davis 912edd1884
Version 0.32.1 2023-11-03 12:43:30 +07:00
Michael Davis fbe3f240df
Version 0.32.0 2023-11-03 12:32:00 +07:00
Michael Davis b7ae2c9374 Generate parser 2023-11-03 16:29:47 +07:00
Michael Davis 23d2b89651
Remove support for 'try' from the parser
This was 'soft-removed' in the past by removing the highlights and test
cases but we held off on fully removing the parser support. This
finishes the job so that 'try' is no longer treated as a keyword.
This should fix the integration tests. Previously they would fail
against some code in the stdlib which used 'try' as a regular variable
name.
2023-10-29 12:14:58 +07:00
Michael Davis 399172f660 Generate parser 2023-10-29 16:12:12 +07:00
Michael Davis e566689d6d
Parse unqualified type imports with 'type Typename' (#73) 2023-10-29 11:11:53 +07:00
Michael Davis f1fa70c8c3
Version 0.31.0 2023-10-29 12:08:22 +07:00
Michael Davis a14043278d Generate parser 2023-10-29 16:04:59 +07:00
Michael Davis c2665c3c3c
highlights: Move operator captures below keyword captures
This fixes the precedence so that `as` is correctly highlighted as a
keyword even when used like a binary operator (see the parent commit).
2023-10-29 12:03:25 +07:00
Michael Davis aa987f8b7a
Allow 'as' keyword in binary pattern match expressions 2023-10-29 12:03:25 +07:00
Michael Davis 4ccb13e253
Version 0.30.5 2023-10-29 11:54:39 +07:00
Michael Davis 32c8f1e32a
Add a test case for record access syntax within guards
This improvement was mentioned in the v0.31.0 release notes. This is
already supported so all I've done is remove the comment about how the
behavior does not yet exist upstream and add a test case.
2023-09-26 11:03:01 +07:00
Michael Davis 297031dce6 Generate parser 2023-09-11 23:15:04 +07:00
Michael Davis 892e3c5fef
Allow function bodies to be optional (#68) 2023-09-11 18:14:46 +07:00
Michael Davis a59aadf3d7
Version 0.30.4 2023-08-27 19:16:34 +07:00
Michael Davis b754c746e3
Version 0.30.3 2023-08-27 19:16:07 +07:00
Michael Davis 0e82111ed6
Version 0.30.2 2023-08-27 19:15:16 +07:00
Michael Davis 07abf846ae
Version 0.30.1 2023-08-27 19:14:57 +07:00
Michael Davis 01a688709a
Version 0.30.0 2023-08-27 19:14:19 +07:00
Michael Davis 7cc7702f2e Generate parser 2023-08-28 00:10:56 +07:00
Michael Davis 5035109688
Add 'as message' syntax for todo and panic (#64) 2023-08-27 19:10:26 +07:00
Michael Davis 8d712c03ab Generate parser 2023-08-28 00:10:15 +07:00
Michael Davis a1c34b0286
Make 'external' part of external type definitions optional (#63) 2023-08-27 19:09:14 +07:00
Michael Davis 0042037c31 Generate parser 2023-08-28 00:08:58 +07:00
Michael Davis 01cba6b1a1
Parse attribute syntax (#65) 2023-08-27 19:08:32 +07:00
Michael Davis fdb4962bae
Version 0.29.0 2023-08-27 18:54:21 +07:00
Michael Davis b477444bc4
Version 0.28.3 2023-08-27 18:50:22 +07:00
Michael Davis a75656a56b
Version 0.28.2 2023-08-27 18:45:45 +07:00
Michael Davis e8feaf9491 Generate parser 2023-08-27 23:45:04 +07:00
Michael Davis ef45f3b044
Add 'use_assignment' and 'use_assignments' nodes under 'use'
Previously the 'use' node would have many 'identifier' or pattern nodes
and, with the parent commit, types as well. This change should make it
easier to figure out which children nodes of 'use' are associated with
one another.

Co-authored-by: Jonathan Arnett <jonarnett90@gmail.com>
2023-08-27 18:33:10 +07:00
Marcin Koziej ceb48343f7
Add optional type annotations to use assignment 2023-08-27 18:28:54 +07:00
Marcin Koziej 766a2df232
Add test example for issue #56 2023-08-27 18:27:57 +07:00
Amaan Qureshi 4f4e80fd61 Generate parser 2023-08-27 22:41:25 +07:00
Amaan Qureshi 07da684bad
Remove unnecessary conflict (#66) 2023-08-27 17:40:57 +07:00
Michael Davis 8302c98ed7 Remove support for 'try' (#53)
'try' has been removed from the upstream parser.
2023-07-29 21:00:46 +07:00
Alex Manning 80ae1e8de4 Generate parser 2023-07-29 21:00:46 +07:00
Alex Manning afddec2b17 support empty case clauses to prevent parsing error 2023-07-29 21:00:46 +07:00
Jonathan Arnett ea0b0df4be Update backwards-compatibility policy 2023-07-29 19:58:22 +07:00
Jonathan Arnett d83f2eed42 Write basic backwards-compatibility policy 2023-07-29 19:17:12 +07:00
Jonathan Arnett 93e3729ad6 Fix highlight test for unary negation
Co-authored-by: Michael Davis <mcarsondavis@gmail.com>
2023-07-29 19:17:12 +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
Jonathan Arnett 136eaebe7b Semicolons are no longer whitespace 2023-07-29 19:16:40 +07:00
Jonathan Arnett d06bad63d7 Rename "expression_group" to "block" 2023-07-29 19:16:16 +07:00
Jonathan Arnett cd03a61878 Make "let assert" a statement instead of an expression
This makes me a little uneasy, as the way that the Gleam parser parses
"let assert" is that it first parses "let", then calls
"parse_assignment" which will look to see if an "assert" comes next,
and uses this information to choose the node type.

I think a closer tree-sitter implementation would look like this:

_statement: ($) => choice($._expression, $._assignment, $.use),
...
_assignment: ($) => choice($.let, $.let_assert),
let: ($) => seq("let", $._assignment2),
let_assert: ($) => seq("let", "assert", $._assignment2)
_assignment2: ($) =>
  ...

However this requires an awkward "_assignment2" and isn't
substantially closer to the Gleam parser to warrant the change.

Also we could simply do `optional("assert")`, but that would make
"let" and "let assert" the same node type, which I suspect is an anti-feature.
2023-07-29 19:15:21 +07:00
Michael Davis 31418e5219 Generate parser 2023-04-07 14:58:28 +07:00
Michael Davis c29d291424 Reclassify 'let' and 'use' as statements
With the latest changes to the gleam parser, code that uses let/use as
expressions is now rejected. This change reorganizes let and use under
a new '_statement' rule. This restricts let/use from taking other
let/use statements since they only accept expressions.
2023-04-07 10:58:08 +07:00
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