diff options
-rw-r--r-- | CHANGES | 8 | ||||
-rw-r--r-- | pygments/lexers/_mapping.py | 4 | ||||
-rw-r--r-- | pygments/lexers/floscript.py | 18 | ||||
-rw-r--r-- | tests/examplefiles/example.flo | 40 |
4 files changed, 60 insertions, 10 deletions
@@ -10,6 +10,14 @@ Version 2.4.0 ------------- (not released yet) +- Added lexers: + + * FloScript (PR#750) + +- Updated lexers: + + * Terraform (PR#787) + - Change ANSI color names (PR#777) Version 2.3.1 diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py index 1e56e262..f51d9047 100644 --- a/pygments/lexers/_mapping.py +++ b/pygments/lexers/_mapping.py @@ -51,7 +51,7 @@ LEXERS = { 'BCLexer': ('pygments.lexers.algebra', 'BC', ('bc',), ('*.bc',), ()), 'BSTLexer': ('pygments.lexers.bibtex', 'BST', ('bst', 'bst-pybtex'), ('*.bst',), ()), 'BaseMakefileLexer': ('pygments.lexers.make', 'Base Makefile', ('basemake',), (), ()), - 'BashLexer': ('pygments.lexers.shell', 'Bash', ('bash', 'sh', 'ksh', 'zsh', 'shell'), ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', '*.exheres-0', '*.exlib', '*.zsh', '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'zshrc', '.zshrc', 'PKGBUILD'), ('application/x-sh', 'application/x-shellscript')), + 'BashLexer': ('pygments.lexers.shell', 'Bash', ('bash', 'sh', 'ksh', 'zsh', 'shell'), ('*.sh', '*.ksh', '*.bash', '*.ebuild', '*.eclass', '*.exheres-0', '*.exlib', '*.zsh', '.bashrc', 'bashrc', '.bash_*', 'bash_*', 'zshrc', '.zshrc', 'PKGBUILD'), ('application/x-sh', 'application/x-shellscript', 'text/x-shellscript')), 'BashSessionLexer': ('pygments.lexers.shell', 'Bash Session', ('console', 'shell-session'), ('*.sh-session', '*.shell-session'), ('application/x-shell-session', 'application/x-sh-session')), 'BatchLexer': ('pygments.lexers.shell', 'Batchfile', ('bat', 'batch', 'dosbatch', 'winbatch'), ('*.bat', '*.cmd'), ('application/x-dos-batch',)), 'BefungeLexer': ('pygments.lexers.esoteric', 'Befunge', ('befunge',), ('*.befunge',), ('application/x-befunge',)), @@ -156,7 +156,7 @@ LEXERS = { 'FennelLexer': ('pygments.lexers.lisp', 'Fennel', ('fennel', 'fnl'), ('*.fnl',), ()), 'FishShellLexer': ('pygments.lexers.shell', 'Fish', ('fish', 'fishshell'), ('*.fish', '*.load'), ('application/x-fish',)), 'FlatlineLexer': ('pygments.lexers.dsls', 'Flatline', ('flatline',), (), ('text/x-flatline',)), - 'FloScriptLexer': ('pygments.lexers.floscript', 'FloScript', ('floscript|flo',), ('*.flo',), ()), + 'FloScriptLexer': ('pygments.lexers.floscript', 'FloScript', ('floscript', 'flo'), ('*.flo',), ()), 'ForthLexer': ('pygments.lexers.forth', 'Forth', ('forth',), ('*.frt', '*.fs'), ('application/x-forth',)), 'FortranFixedLexer': ('pygments.lexers.fortran', 'FortranFixed', ('fortranfixed',), ('*.f', '*.F'), ()), 'FortranLexer': ('pygments.lexers.fortran', 'Fortran', ('fortran',), ('*.f03', '*.f90', '*.F03', '*.F90'), ('text/x-fortran',)), diff --git a/pygments/lexers/floscript.py b/pygments/lexers/floscript.py index 9efee613..b393c1e9 100644 --- a/pygments/lexers/floscript.py +++ b/pygments/lexers/floscript.py @@ -3,7 +3,7 @@ pygments.lexers.floscript ~~~~~~~~~~~~~~~~~~~~~~ - Lexer for FloScript + Lexer for FloScript :copyright: Copyright 2006-2017 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. @@ -23,12 +23,14 @@ __all__ = ['FloScriptLexer',] class FloScriptLexer(RegexLexer): """ For `FloScript <https://github.com/ioflo/ioflo>`_ configuration language source code. + + .. versionadded:: 2.4 """ name = 'FloScript' - aliases = ['floscript|flo'] + aliases = ['floscript', 'flo'] filenames = ['*.flo'] - + def innerstring_rules(ttype): return [ # the old style '%s' % (...) string formatting @@ -47,13 +49,13 @@ class FloScriptLexer(RegexLexer): 'root': [ (r'\n', Text), (r'[^\S\n]+', Text), - + (r'[]{}:(),;[]', Punctuation), (r'\\\n', Text), (r'\\', Text), (r'(to|by|with|from|per|for|cum|qua|via|as|at|in|of|on|re|is|if|be|into|and|not)\b', Operator.Word), (r'!=|==|<<|>>|[-~+/*%=<>&^|.]', Operator), - (r'(load|init|server|logger|log|loggee|first|over|under|next|done|timeout|repeat|native|benter|enter|recur|exit|precur|renter|rexit|print|put|inc|copy|set|aux|rear|raze|go|let|do|bid|ready|start|stop|run|abort|use|flo|give|take)\b', Name.Builtin), + (r'(load|init|server|logger|log|loggee|first|over|under|next|done|timeout|repeat|native|benter|enter|recur|exit|precur|renter|rexit|print|put|inc|copy|set|aux|rear|raze|go|let|do|bid|ready|start|stop|run|abort|use|flo|give|take)\b', Name.Builtin), (r'(frame|framer|house)\b', Keyword), ('"', String, 'string'), @@ -74,12 +76,12 @@ class FloScriptLexer(RegexLexer): (r'\d+L', Number.Integer.Long), (r'\d+j?', Number.Integer) ], - + 'name': [ (r'@[\w.]+', Name.Decorator), (r'[a-zA-Z_]\w*', Name), ], - - + + } diff --git a/tests/examplefiles/example.flo b/tests/examplefiles/example.flo new file mode 100644 index 00000000..2d4ab5e7 --- /dev/null +++ b/tests/examplefiles/example.flo @@ -0,0 +1,40 @@ +#example mission box1.flo +#from: https://github.com/ioflo/ioflo + +house box1 + + framer vehiclesim be active first vehicle_run + frame vehicle_run + do simulator motion uuv + + framer mission be active first northleg + frame northleg + set elapsed with 20.0 + set heading with 0.0 + set depth with 5.0 + set speed with 2.5 + go next if elapsed >= goal + + frame eastleg + set heading with 90.0 + go next if elapsed >= goal + + frame southleg + set heading with 180.0 + go next if elapsed >= goal + + frame westleg + set heading with 270.0 + go next if elapsed >= goal + + frame mission_stop + bid stop vehiclesim + bid stop autopilot + bid stop me + + framer autopilot be active first autopilot_run + frame autopilot_run + do controller pid speed + do controller pid heading + do controller pid depth + do controller pid pitch
\ No newline at end of file |