summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2016-02-17 09:38:21 +0100
committerGeorg Brandl <georg@python.org>2016-02-17 09:38:21 +0100
commit4e0eafc0d0df74e4c970cac0d3d9a6faa4d8b0bf (patch)
tree5b0f4015714ac560d4c355303f38d8b183597983
parentd86bc7cb6ebe5193ec1217b0cfa3a6b3164caa5a (diff)
downloadpygments-4e0eafc0d0df74e4c970cac0d3d9a6faa4d8b0bf.tar.gz
Flatline: add to changelog, style nits.
-rw-r--r--CHANGES1
-rw-r--r--pygments/lexers/_mapping.py2
-rw-r--r--pygments/lexers/dsls.py57
3 files changed, 31 insertions, 29 deletions
diff --git a/CHANGES b/CHANGES
index edf4e0b6..4399121f 100644
--- a/CHANGES
+++ b/CHANGES
@@ -18,6 +18,7 @@ Version 2.2
* Varnish config (PR#554)
* Clean (PR#503)
* WDiff (PR#513)
+ * Flatline (PR#551)
- Added `lexers.find_lexer_class_by_name()`. (#1203)
diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py
index 8650b7e4..561d2344 100644
--- a/pygments/lexers/_mapping.py
+++ b/pygments/lexers/_mapping.py
@@ -146,7 +146,7 @@ LEXERS = {
'FantomLexer': ('pygments.lexers.fantom', 'Fantom', ('fan',), ('*.fan',), ('application/x-fantom',)),
'FelixLexer': ('pygments.lexers.felix', 'Felix', ('felix', 'flx'), ('*.flx', '*.flxh'), ('text/x-felix',)),
'FishShellLexer': ('pygments.lexers.shell', 'Fish', ('fish', 'fishshell'), ('*.fish', '*.load'), ('application/x-fish',)),
- 'FlatlineLexer': ('pygments.lexers.dsls', 'Flatline', ('flatline',), (), ()),
+ 'FlatlineLexer': ('pygments.lexers.dsls', 'Flatline', ('flatline',), (), ('text/x-flatline',)),
'FortranFixedLexer': ('pygments.lexers.fortran', 'FortranFixed', ('fortranfixed',), ('*.f', '*.F'), ()),
'FortranLexer': ('pygments.lexers.fortran', 'Fortran', ('fortran',), ('*.f03', '*.f90', '*.F03', '*.F90'), ('text/x-fortran',)),
'FoxProLexer': ('pygments.lexers.foxpro', 'FoxPro', ('foxpro', 'vfp', 'clipper', 'xbase'), ('*.PRG', '*.prg'), ()),
diff --git a/pygments/lexers/dsls.py b/pygments/lexers/dsls.py
index e1362649..6032017f 100644
--- a/pygments/lexers/dsls.py
+++ b/pygments/lexers/dsls.py
@@ -693,42 +693,43 @@ class CrmshLexer(RegexLexer):
],
}
+
class FlatlineLexer(RegexLexer):
"""
- Lexer for `Flatline <https://github.com/bigmlcom/flatline>`_ expressions
+ Lexer for `Flatline <https://github.com/bigmlcom/flatline>`_ expressions.
- .. versionadded::2.2
+ .. versionadded:: 2.2
"""
name = 'Flatline'
aliases = ['flatline']
filenames = []
- mimetypes = ['text/plain']
+ mimetypes = ['text/x-flatline']
- special_forms = ('let')
+ special_forms = ('let',)
builtins = (
- "!=","*","+","-","<","<=","=",">",">=","abs","acos","all","all-but",
- "all-with-defaults","all-with-numeric-default","and","asin","atan",
- "avg","avg-window","bin-center","bin-count","call","category-count",
- "ceil","cond","cond-window","cons","cos","cosh","count","diff-window",
- "div","ensure-value","ensure-weighted-value","epoch","epoch-day",
- "epoch-fields","epoch-hour","epoch-millisecond","epoch-minute",
- "epoch-month","epoch-second","epoch-weekday","epoch-year","exp","f",
- "field","field-prop","fields","filter","first","floor","head","if",
- "in","integer","language","length","levenshtein","linear-regression",
- "list","ln","log","log10","map","matches","matches?","max","maximum",
- "md5","mean","median","min","minimum","missing","missing-count",
- "missing?","missing_count","mod","mode","normalize","not","nth",
- "occurrences","or","percentile","percentile-label","population",
- "population-fraction","pow","preferred","preferred?","quantile-label",
- "rand","rand-int","random-value","re-quote","real","replace",
- "replace-first","rest","round","row-number","segment-label","sha1",
- "sha256","sin","sinh","sqrt","square","standard-deviation",
- "standard_deviation","str","subs","sum","sum-squares","sum-window",
- "sum_squares","summary","summary-no","summary-str","tail","tan",
- "tanh","to-degrees","to-radians","variance","vectorize",
- "weighted-random-value","window","winnow","within-percentiles?",
- "z-score"
+ "!=", "*", "+", "-", "<", "<=", "=", ">", ">=", "abs", "acos", "all",
+ "all-but", "all-with-defaults", "all-with-numeric-default", "and",
+ "asin", "atan", "avg", "avg-window", "bin-center", "bin-count", "call",
+ "category-count", "ceil", "cond", "cond-window", "cons", "cos", "cosh",
+ "count", "diff-window", "div", "ensure-value", "ensure-weighted-value",
+ "epoch", "epoch-day", "epoch-fields", "epoch-hour", "epoch-millisecond",
+ "epoch-minute", "epoch-month", "epoch-second", "epoch-weekday",
+ "epoch-year", "exp", "f", "field", "field-prop", "fields", "filter",
+ "first", "floor", "head", "if", "in", "integer", "language", "length",
+ "levenshtein", "linear-regression", "list", "ln", "log", "log10", "map",
+ "matches", "matches?", "max", "maximum", "md5", "mean", "median", "min",
+ "minimum", "missing", "missing-count", "missing?", "missing_count",
+ "mod", "mode", "normalize", "not", "nth", "occurrences", "or",
+ "percentile", "percentile-label", "population", "population-fraction",
+ "pow", "preferred", "preferred?", "quantile-label", "rand", "rand-int",
+ "random-value", "re-quote", "real", "replace", "replace-first", "rest",
+ "round", "row-number", "segment-label", "sha1", "sha256", "sin", "sinh",
+ "sqrt", "square", "standard-deviation", "standard_deviation", "str",
+ "subs", "sum", "sum-squares", "sum-window", "sum_squares", "summary",
+ "summary-no", "summary-str", "tail", "tan", "tanh", "to-degrees",
+ "to-radians", "variance", "vectorize", "weighted-random-value", "window",
+ "winnow", "within-percentiles?", "z-score",
)
valid_name = r'(?!#)[\w!$%*+<=>?/.#-]+'
@@ -741,7 +742,7 @@ class FlatlineLexer(RegexLexer):
# numbers
(r'-?\d+\.\d+', Number.Float),
(r'-?\d+', Number.Integer),
- (r'0x-?[abcdef\d]+', Number.Hex),
+ (r'0x-?[a-f\d]+', Number.Hex),
# strings, symbols and characters
(r'"(\\\\|\\"|[^"])*"', String),
@@ -765,4 +766,4 @@ class FlatlineLexer(RegexLexer):
# parentheses
(r'(\(|\))', Punctuation),
],
- } \ No newline at end of file
+ }