Refactor Parser States
Refactor the class hierarchy for parser states so that there is a parser state that acts more like a type and one that acts more like a value (the latter, then, serves as the base class for the other instantiated parser states). Signed-off-by: Will Hawkins <hawkinsw@obs.cr>
This commit is contained in:
@@ -56,7 +56,7 @@ import P4Lang
|
||||
|
||||
#expect(parser.states.count() == 1)
|
||||
|
||||
let state = try! #require(parser.states.find(withIdentifier: Identifier(name: "start")))
|
||||
let state = AsInstantiatedParserState((try! #require(parser.states.find(withIdentifier: Identifier(name: "start")))))
|
||||
#expect(state.state == Identifier(name: "start"))
|
||||
#expect(state.statements.count == 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user