Last active
November 21, 2019 18:26
-
-
Save jozefchmelar/2e3b70a0e84d1fa4fc938556a7743491 to your computer and use it in GitHub Desktop.
Writing the text
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override void AcceptVisitor(IAstVisitor visitor) | |
{ | |
if(Parent is RootAst) // in case it's top level we want to have <p> tag, if it's inside <b> tag we dont need it. | |
visitor.BeginVisit(this); | |
if(visitor is IAstWriteableVisitor writeableVisitor) | |
writeableVisitor.Write(Text); /// here you output the text. | |
if (Parent is RootAst) | |
visitor.EndVisit(this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment