feat: first chunk of lexer/parser translation.
This commit is contained in:
@@ -10,11 +10,10 @@ public partial class Listener
|
||||
|
||||
public override void ExitStory(InkBlotAntlrGrammarParser.StoryContext context)
|
||||
{
|
||||
var storyNodes = context.children.Select(child => child switch
|
||||
{
|
||||
InkBlotAntlrGrammarParser.ContentTextContext contentText => new Content(GetContentText(contentText)),
|
||||
_ => throw new InvalidOperationException($"unknown context of type {child.GetType()}")
|
||||
});
|
||||
var storyNodes = context
|
||||
.topLevelStatements()
|
||||
.contentText()
|
||||
.Select(child => new Content(GetContentText(child)));
|
||||
_story = new Story(storyNodes);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user