Skip to content

Commit

Permalink
feat: continuations
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed Jan 24, 2024
1 parent 60e71b3 commit 0c47f54
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ module.exports = grammar({
$.type_annotation,
$.param_annotation,
$.alias_annotation,
$.continuation,
$.return_annotation,
$.field_annotation,
$.qualifier_annotation,
Expand Down Expand Up @@ -77,6 +78,12 @@ module.exports = grammar({
optional(choice($.at_comment, $.comment)),
),

continuation: $ => seq(
'|',
$.type,
optional(choice($.at_comment, $.comment)),
),

return_annotation: $ => seq(
'@return',
$.type,
Expand Down
13 changes: 13 additions & 0 deletions test/corpus/annotations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -395,3 +395,16 @@ Test a Tuple Type
(builtin_type)))
(identifier)
(identifier)))))

=========================
Test a Continuation
=========================

| '"left"' # The left side of the device

---

(documentation
(continuation
(literal_type)
(comment)))

0 comments on commit 0c47f54

Please sign in to comment.