lexer foo_lexer { @trivia() whitespace <- p"[ \n\r\t]+" family alphanumericals { def <- "def" } var <- "var" family alphanumericals { error <- "error" example <- "example" null_tok <- "null" } family punctuation { comma <- "," dot <- "." semicolon <- ";" l_par <- "(" r_par <- ")" l_brace <- "{" r_brace <- "}" equal <- "=" plus <- "+" } minus <- "-" less_than <- "<" @unparse_spacing(with=alphanumericals) family alphanumericals { number <- p"[0-9]+" @symbol() identifier <- p"[a-zA-Z_][a-zA-Z0-9_]*" } string <- p"\"[^\"]*\"" family comments { @unparse_newline_after @trivia() comment <- p"#(.?)+" } }