Add Tree Sitter Tests for Annotations (And General Test Updates)

Update Tests

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-03-10 05:41:28 -04:00
parent 4269104379
commit 4e9927c601
3 changed files with 104 additions and 3 deletions
+101
View File
@@ -0,0 +1,101 @@
=========================
Simple Annotated Declaration
=========================
@testing parser simple() {
state start {
bool l;
transition accept;
}
};
---
(p4program
(declaration
(parserDeclaration
(parserType
(annotations
(annotation
(annotation_literal)
)
)
(parser)
(identifier)
)
(parserStates
(parserState
(state)
(identifier)
(parserStatements
(parserStatement
(variableDeclaration
(typeRef
(baseType
(bool)
)
)
(identifier)
)
)
)
(parserTransitionStatement
(transition)
(transitionSelectionExpression
(identifier)
)
)
)
)
)
)
)
=========================
Simple Annotated State
=========================
parser simple() {
@testing state start {
bool l;
transition accept;
}
};
---
(p4program
(declaration
(parserDeclaration
(parserType
(parser)
(identifier)
)
(parserStates
(parserState
(annotations
(annotation
(annotation_literal)
)
)
(state)
(identifier)
(parserStatements
(parserStatement
(variableDeclaration
(typeRef
(baseType
(bool)
)
)
(identifier)
)
)
)
(parserTransitionStatement
(transition)
(transitionSelectionExpression
(identifier)
)
)
)
)
)
)
)