pub enum Dialect {
Show 18 variants
Standard,
Jsx,
Tsx,
ObjectiveC,
ObjectiveCpp,
GnuC,
GnuCpp,
Cuda,
PosixSh,
Bash53,
Zsh,
PostgreSql,
MySql,
Sqlite,
TSql,
Oracle,
Scss,
Sass,
}Expand description
A vendor or extension variant of a Language’s lexical rules.
A dialect never changes the file type: Self::MySql is still
Language::Sql. It changes what counts as a string, an identifier, or a
comment while scanning. Naming one a language does not support is an error
rather than a silent fallback.
Variants§
Standard
The language’s own rules, with no vendor extension. The default.
Jsx
JavaScript with JSX syntax enabled.
Tsx
TypeScript with TSX syntax enabled.
ObjectiveC
Objective-C. The comment rules are C’s; the dialect records the flavour of the file.
ObjectiveCpp
Objective-C++. The comment rules are C++’s.
GnuC
C with the GNU extensions. The comment rules are C’s.
GnuCpp
C++ with the GNU extensions. The comment rules are C++’s.
Cuda
CUDA C++. The comment rules are C++’s.
PosixSh
POSIX sh, which has no $'...' ANSI-C quoted strings.
Bash53
Bash 5.3, which adds $'...' ANSI-C quoted strings.
Zsh
Zsh, which also has $'...' ANSI-C quoted strings.
PostgreSql
PostgreSQL: nested /* ... */, $tag$ ... $tag$ dollar-quoted
strings, and backslash escapes inside E'...'.
MySql
MySQL: # line comments, -- only when a boundary follows, strings
in double quotes, and backslash escapes.
Sqlite
SQLite, which uses the standard SQL rules.
TSql
Transact-SQL: nested /* ... */ and [bracketed] identifiers.
Oracle
Oracle, which adds q'[...]' quoted literals.
Scss
SCSS: CSS with // line comments and #{ ... } interpolation.
Sass
The indentation-based Sass syntax. Silent comments also own their more-deeply-indented body lines.