Refactor Parsers and Parser States

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-03-10 03:56:18 -04:00
parent 7c7416fa64
commit 3188b52965
12 changed files with 223 additions and 381 deletions
+4 -3
View File
@@ -73,11 +73,12 @@ import TreeSitterP4
"""
let program = try #UseOkResult(Program.Compile(simple_parser_declaration))
let runtime = try #UseOkResult(P4Runtime.ParserRuntime.create(program: program))
#expect(
#RequireErrorResult<ParserRuntime>(
Error(withMessage: "No start state defined"),
P4Runtime.ParserRuntime.create(program: program)))
#RequireErrorResult<(ParserState, ProgramExecution)>(
Error(withMessage: "Could not find the start state"),
runtime.run()))
}
@Test func test_simple_parser_with_transition_select_expression() async throws {