diff options
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | pygments/lexers/_mapping.py | 2 | ||||
-rw-r--r-- | pygments/lexers/dsls.py | 57 |
3 files changed, 31 insertions, 29 deletions
@@ -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 + } |