macro_token

func macro_token(token: Token) -> MacroToken

Flattens a lexer token into the macro-service ABI representation.

Kind and both source ranges are preserved exactly; token text remains in the accompanying source and is not copied into the record.

View Source
pub func macro_token(token: Token) -> MacroToken {
	MacroToken(
		kind: token.kind,
		span_start: token.span.lower,
		span_end: token.span.upper,
		lexeme_start: token.lexeme.lower,
		lexeme_end: token.lexeme.upper
	)
}