Commit Graph

17 Commits (e451746f7148b4ddeddf504d7b54d68872ba6002)

Author SHA1 Message Date
Gears e451746f71
Add support for `let assert ... as` (#107) 2024-11-25 18:34:56 +07:00
Giacomo Cavalieri 9a66875ae1
Tests for label shorthands 2024-07-25 15:48:57 +07:00
Michael Davis 5035109688
Add 'as message' syntax for todo and panic (#64) 2023-08-27 19:10:26 +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
Jonathan Arnett d06bad63d7 Rename "expression_group" to "block" 2023-07-29 19:16:16 +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
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 d14acab7f2
add `panic` keyword / add contributing section to Readme (#46) 2023-03-03 11:38:22 +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 ed604993ba
Forbid anonymous function parameter labels (#34)
Corresponds to gleam-lang/gleam#1629
2022-06-20 13:13:52 +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 11d78be28e
generalize bit string option node (#22)
* generalize bit string option node
* highlight bit-string options as function.builtin
2022-03-11 14:16:12 +07:00
Michael Davis ce6ee5195b
add visibility_modifier and opacity_modifier rules (#18)
closes #17

This refactor brings this grammar more in line with tree-sitter-rust.
A function or type declaration may have a visibility modifier ("pub") and
type declarations may also have an opacity modifier ("opaque"). This ends
up reducing the number of named rules, which cleans up the queries a bit.
2022-02-27 21:49:32 +07:00
Jonathan Arnett 0b8f7bcae9 Move corpus/ under test/ 2022-02-24 18:48:31 +07:00