Support Calling Parsers With Parameters

Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
Will Hawkins
2026-04-02 01:28:43 -04:00
parent 7cdbee1999
commit d971aab1fe
12 changed files with 345 additions and 82 deletions
@@ -169,3 +169,16 @@ import P4Lang
#expect(parameters.parameters[2].name == Identifier(name: "imtr"))
#expect(parameters.parameters[2].type.eq(rhs: P4Int()))
}
@Test func test_simple_compiler_parser_use_parameters() async throws {
let simple = """
parser main_parser(bool pmtr, string smtr, int imtr) {
state start {
pmtr = true;
transition accept;
}
};
"""
#expect(#RequireOkResult(Program.Compile(simple)))
}