difftastic/config/syntax.toml

189 lines
3.5 KiB
TOML

[JavaScript]
extensions = ["js"]
atom_patterns = [
# Numbers
'[0-9]+',
# Symbols (e.g. variable names)
'[.a-zA-Z0-9_]+',
# Two character operators
'(&&|\|\||\+\+|--|\*\*)',
# Single character operators
'[=<>/*+?:;,-]',
]
string_patterns = [
# Double-quoted strings
'"((\\.)|[^"])*"',
# Single quoted strings
"'((\\\\')|[^'])*'",
# Backtick strings
'`((\\`)|[^`])*1`',
]
comment_patterns = [
# Single line comments
'//.*(\n|$)',
# Mult-line comments
'/\*(?s:.)*?\*/',
]
open_delimiter_pattern = '(\[|\{|\()'
close_delimiter_pattern = '(\]|\}|\))'
[JSON]
extensions = ["json"]
atom_patterns = [
# Numbers
'[0-9]+',
# Booleans
'(true)|(false)|(null)',
# Punctuation
"[:,]",
]
string_patterns = [
# Double-quoted strings
'"((\\")|[^"])*"',
]
comment_patterns = []
open_delimiter_pattern = '(\[|\{)'
close_delimiter_pattern = '(\]|\})'
[CSS]
extensions = ["css"]
atom_patterns = [
# Numbers
'[0-9]+',
# Symbols (e.g. variable names)
'[.a-zA-Z0-9_]+',
# Punctuation
'[:;]',
]
string_patterns = [
# Double-quoted strings
'"((\\.)|[^"])*"',
# Single quoted strings
"'((\\\\')|[^'])*'",
]
comment_patterns = [
# Mult-line comments
'/\*(?s:.)*?\*/',
]
open_delimiter_pattern = '(\[|\{|\()'
close_delimiter_pattern = '(\]|\}|\))'
["Emacs Lisp"]
extensions = ["el"]
atom_patterns = [
# Numbers
'[0-9]+',
# Symbols (e.g. variable names)
'[a-zA-Z0-9_?:/*+=-]+',
# Operators
"[`',#.&]",
]
string_patterns = [
# Double-quoted strings
'"((\\.)|[^"])*"',
]
comment_patterns = [
';.*',
]
open_delimiter_pattern = '(\[|\{|\()'
close_delimiter_pattern = '(\]|\}|\))'
[Scheme]
extensions = ["scm"]
atom_patterns = [
# Numbers
'[0-9]+',
# Symbols (e.g. variable names)
'#?[a-zA-Z0-9_?:/*=-]+',
# Operators
"[`',#.]",
]
string_patterns = [
# Double-quoted strings
'"((\\")|[^"])*"',
]
comment_patterns = [
';.*',
]
open_delimiter_pattern = '(\[|\{|\()'
close_delimiter_pattern = '(\]|\}|\))'
[OCaml]
extensions = ["ml", "mli"]
atom_patterns = [
# Numbers
'[0-9]+',
# Symbols (e.g. variable names)
'[.a-zA-Z0-9_]+',
# Two character operators
'(->|<-|:=|&&|\|\|)',
# Single character operators
"[?~=<>/*+,&|:;'#!-]",
]
string_patterns = [
# Double-quoted strings
'"((\\.)|[^"])*"',
]
comment_patterns = [
# Mult-line comments
'\(\*(?s:.)*?\*\)',
]
open_delimiter_pattern = '(\[|\{|\()'
close_delimiter_pattern = '(\]|\}|\))'
[Clojure]
extensions = ["clj"]
atom_patterns = [
# Numbers
'[0-9]+',
# Symbols (e.g. variable names)
':?[a-zA-Z0-9_>+=-]+',
# Two character operators
'(==)',
# Single character operators
"[`'~@&]",
]
string_patterns = [
# Double-quoted strings
'"((\\.)|[^"])*"',
]
comment_patterns = [
';.*',
]
open_delimiter_pattern = '(\[|\{|\()'
close_delimiter_pattern = '(\]|\}|\))'
[Rust]
extensions = ["rs"]
atom_patterns = [
# Numbers
'[0-9]+',
# Single quoted character 'a' or '\n', trying to avoid matching
# lifetimes.
"'..?'",
# Lifetimes
"'[a-z_]+",
# Bindings in macros.
"\\$[a-z_]+",
# Symbols (e.g. variable names)
'[a-zA-Z0-9_]+!?',
# Two character operators
'(::|&&|\|\||\.\.|=>|<=|>=|==|!=)',
# Single character operators
# | is a delimiter for lambdas, but also used in pattern matching.
'[.&=<>/*+:;,|#!?$-]',
]
string_patterns = [
# Double-quoted strings
'"((\\.)|[^"])*"',
]
comment_patterns = [
# Single line comments
'//.*(\n|$)',
# Mult-line comments
'/\*(?s:.)*?\*/',
]
open_delimiter_pattern = '(\[|\{|\()'
close_delimiter_pattern = '(\]|\}|\))'