MapMatchersToTokens
export type MapMatchersToTokens<Matchers extends TokenMatcher[]> = {[M in keyof Matchers]: Matchers[M] extends TokenMatcher<unknown>
? T extends GenericGroup<Token[]>
? GenericGroup<TokenReader>
: T
: never}
Maps a tuple of matchers to a tuple of equivalent token types:
- TokenMatcher<BoolLiteral> is mapped to BoolLiteral
- TokenMatcher<ByteArrayLiteral> is mapped to ByteArrayLiteral
- TokenMatcher<Comment is mapped to Comment
- TokenMatcher<IntLiteral is mapped to IntLiteral
- TokenMatcher<RealLiteral is mapped to RealLiteral
- TokenMatcher<StringLiteral is mapped to StringLiteral
- TokenMatcher<SymbolToken is mapped to SymbolToken
- TokenMatcher<TokenGroup> is augmented and mapped GenericGroup<TokenReader>
- TokenMatcher<Word> is mapped to Word