mirror of
https://github.com/AdaCore/langkit.git
synced 2026-02-12 12:28:12 -08:00
When enabled, this new option triggers the lexer engine to perform "native" case insentivity and provides a default symbol canonicalizer that just converts names to lower case. TN: U118-054
50 lines
847 B
Plaintext
50 lines
847 B
Plaintext
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]+|0x[0-9a-f]+"
|
|
@symbol()
|
|
identifier <- p"[a-zA-Z_][a-zA-Z0-9_]*"
|
|
}
|
|
|
|
string <- p"\"[^\"]*\""
|
|
|
|
family comments {
|
|
@unparse_newline_after
|
|
@trivia()
|
|
comment <- p"#(.?)+"
|
|
}
|
|
|
|
}
|