(for those curious, there needs to be special care taken with Array Types, Nullable Types and Namespace or TypeName entries so that they don't infinitely loop. You can't just parse their entries individually, you need to look for the rank specifiers, ?, and . respectively and shortcut things if they're not there)
I'm sure there's tons more little gotchas or things I typo'd. I'll fix/clean these as I need or come across them, but this should be good enough to begin on the simple extension. First on the chart is replacing is/as/(cast) with ducktyping equivalents.
And tonight's 'screenshot':
Parsing target:
class foo{}
Resultant un-pruned tree:
CompilationUnit 0:4 - class foo {} rms.Support.Parsing.Token.Sequence 0:4 - class foo {} rms.Support.Parsing.Token.Sequence 0:0 - rms.Support.Parsing.Token.Sequence 0:0 - rms.Support.Parsing.Token.Series 0:0 - rms.Support.Parsing.Token.Series 0:0 - rms.Support.Parsing.Token.Series 0:0 - rms.Support.Parsing.Token.Series 0:4 - class foo {} TypeDeclaration 0:4 - class foo {} ClassDeclaration 0:4 - class foo {} rms.Support.Parsing.Token.Sequence 0:4 - class foo {} rms.Support.Parsing.Token.Sequence 0:4 - class foo {} rms.Support.Parsing.Token.Sequence 0:2 - class foo rms.Support.Parsing.Token.Sequence 0:2 - class foo rms.Support.Parsing.Token.Sequence 0:2 - class foo rms.Support.Parsing.Token.Sequence 0:2 - class foo rms.Support.Parsing.Token.Sequence 0:1 - class rms.Support.Parsing.Token.Sequence 0:0 - rms.Support.Parsing.Token.Sequence 0:0 - rms.Support.Parsing.Token.Series 0:0 - rms.Support.Parsing.Token.Series 0:0 - rms.Support.Parsing.Token.LiteralTokenParser 0:0 - ClassKeyword 0:1 - class rms.Support.Parsing.Token.LiteralTokenParser 0:1 - class Identifier 1:2 - foo rms.Support.Parsing.Token.TokenTypeParser 1:2 - foo rms.Support.Parsing.Token.LiteralTokenParser 2:2 - rms.Support.Parsing.Token.LiteralTokenParser 2:2 - rms.Support.Parsing.Token.Series 2:2 - ClassBody 2:4 - {} rms.Support.Parsing.Token.Sequence 2:4 - {} rms.Support.Parsing.Token.Sequence 2:3 - { rms.Support.Parsing.Token.LiteralTokenParser 2:3 - { rms.Support.Parsing.Token.Series 3:3 - rms.Support.Parsing.Token.LiteralTokenParser 3:4 - } rms.Support.Parsing.Token.LiteralTokenParser 4:4 -