Skip to content

Commit 0b5cda1

Browse files
committed
Fix annotation parsing error with inner class signals
1 parent b3a086e commit 0b5cda1

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

grammar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ module.exports = grammar({
363363

364364
signal_statement: ($) =>
365365
seq(
366+
optional($.annotations),
366367
"signal",
367368
field("name", $.name),
368369
optional(field("parameters", $.parameters)),

test/corpus/source.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,27 @@ signal x(a, b: Type)
903903
(identifier)
904904
(type (identifier))))))
905905

906+
=====================================
907+
Signal with annotation in inner class
908+
=====================================
909+
910+
class State:
911+
@warning_ignore("unused_signal")
912+
signal exited
913+
914+
---
915+
916+
(source
917+
(class_definition
918+
name: (name)
919+
body: (class_body
920+
(signal_statement
921+
(annotations
922+
(annotation
923+
(identifier)
924+
arguments: (arguments (string))))
925+
name: (name)))))
926+
906927
=====================================
907928
Class Name
908929
=====================================

0 commit comments

Comments
 (0)