diff options
-rw-r--r-- | pygments/lexers/_mapping.py | 6 | ||||
-rw-r--r-- | pygments/lexers/business.py | 2 | ||||
-rw-r--r-- | pygments/lexers/int_fiction.py | 1 | ||||
-rw-r--r-- | pygments/lexers/rust.py | 2 | ||||
-rw-r--r-- | pygments/lexers/theorem.py | 22 | ||||
-rw-r--r-- | tests/examplefiles/inform6_example | 7 |
6 files changed, 22 insertions, 18 deletions
diff --git a/pygments/lexers/_mapping.py b/pygments/lexers/_mapping.py index 39d5e85a..a08e806c 100644 --- a/pygments/lexers/_mapping.py +++ b/pygments/lexers/_mapping.py @@ -16,9 +16,9 @@ from __future__ import print_function LEXERS = { - 'ABAPLexer': ('pygments.lexers.business', 'ABAP', ('abap',), ('*.abap',), ('text/x-abap',)), - 'AbnfLexer': ('pygments.lexers.grammar_notation', 'ABNF', ('abnf',), ('*.abnf',), ('text/x-abnf',)), + 'ABAPLexer': ('pygments.lexers.business', 'ABAP', ('abap',), ('*.abap', '*.ABAP'), ('text/x-abap',)), 'APLLexer': ('pygments.lexers.apl', 'APL', ('apl',), ('*.apl',), ()), + 'AbnfLexer': ('pygments.lexers.grammar_notation', 'ABNF', ('abnf',), ('*.abnf',), ('text/x-abnf',)), 'ActionScript3Lexer': ('pygments.lexers.actionscript', 'ActionScript 3', ('as3', 'actionscript3'), ('*.as',), ('application/x-actionscript3', 'text/x-actionscript3', 'text/actionscript3')), 'ActionScriptLexer': ('pygments.lexers.actionscript', 'ActionScript', ('as', 'actionscript'), ('*.as',), ('application/x-actionscript', 'text/x-actionscript', 'text/actionscript')), 'AdaLexer': ('pygments.lexers.pascal', 'Ada', ('ada', 'ada95', 'ada2005'), ('*.adb', '*.ads', '*.ada'), ('text/x-ada',)), @@ -346,7 +346,7 @@ LEXERS = { 'RtsLexer': ('pygments.lexers.trafficscript', 'TrafficScript', ('rts', 'trafficscript'), ('*.rts',), ()), 'RubyConsoleLexer': ('pygments.lexers.ruby', 'Ruby irb session', ('rbcon', 'irb'), (), ('text/x-ruby-shellsession',)), 'RubyLexer': ('pygments.lexers.ruby', 'Ruby', ('rb', 'ruby', 'duby'), ('*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec', '*.rbx', '*.duby', 'Gemfile'), ('text/x-ruby', 'application/x-ruby')), - 'RustLexer': ('pygments.lexers.rust', 'Rust', ('rust',), ('*.rs',), ('text/rust',)), + 'RustLexer': ('pygments.lexers.rust', 'Rust', ('rust',), ('*.rs', '*.rs.in'), ('text/rust',)), 'SLexer': ('pygments.lexers.r', 'S', ('splus', 's', 'r'), ('*.S', '*.R', '.Rhistory', '.Rprofile', '.Renviron'), ('text/S-plus', 'text/S', 'text/x-r-source', 'text/x-r', 'text/x-R', 'text/x-r-history', 'text/x-r-profile')), 'SMLLexer': ('pygments.lexers.ml', 'Standard ML', ('sml',), ('*.sml', '*.sig', '*.fun'), ('text/x-standardml', 'application/x-standardml')), 'SassLexer': ('pygments.lexers.css', 'Sass', ('sass',), ('*.sass',), ('text/x-sass',)), diff --git a/pygments/lexers/business.py b/pygments/lexers/business.py index c71d9c28..ea888245 100644 --- a/pygments/lexers/business.py +++ b/pygments/lexers/business.py @@ -244,7 +244,7 @@ class ABAPLexer(RegexLexer): """ name = 'ABAP' aliases = ['abap'] - filenames = ['*.abap'] + filenames = ['*.abap', '*.ABAP'] mimetypes = ['text/x-abap'] flags = re.IGNORECASE | re.MULTILINE diff --git a/pygments/lexers/int_fiction.py b/pygments/lexers/int_fiction.py index 25c472b1..724f9b27 100644 --- a/pygments/lexers/int_fiction.py +++ b/pygments/lexers/int_fiction.py @@ -285,6 +285,7 @@ class Inform6Lexer(RegexLexer): include('_whitespace'), (r';', Punctuation, '#pop'), (r'\*', Punctuation), + (r'"', String.Double, 'plain-string'), (_name, Name.Variable) ], # Array diff --git a/pygments/lexers/rust.py b/pygments/lexers/rust.py index d8939678..5d1162b8 100644 --- a/pygments/lexers/rust.py +++ b/pygments/lexers/rust.py @@ -23,7 +23,7 @@ class RustLexer(RegexLexer): .. versionadded:: 1.6 """ name = 'Rust' - filenames = ['*.rs'] + filenames = ['*.rs', '*.rs.in'] aliases = ['rust'] mimetypes = ['text/rust'] diff --git a/pygments/lexers/theorem.py b/pygments/lexers/theorem.py index 47fdc8b6..60a101cc 100644 --- a/pygments/lexers/theorem.py +++ b/pygments/lexers/theorem.py @@ -43,7 +43,8 @@ class CoqLexer(RegexLexer): 'Proposition', 'Fact', 'Remark', 'Example', 'Proof', 'Goal', 'Save', 'Qed', 'Defined', 'Hint', 'Resolve', 'Rewrite', 'View', 'Search', 'Show', 'Print', 'Printing', 'All', 'Graph', 'Projections', 'inside', - 'outside', 'Check', + 'outside', 'Check', 'Global', 'Instance', 'Class', 'Existing', + 'Universe', 'Polymorphic', 'Monomorphic', 'Context' ) keywords2 = ( # Gallina @@ -64,12 +65,16 @@ class CoqLexer(RegexLexer): 'unfold', 'change', 'cutrewrite', 'simpl', 'have', 'suff', 'wlog', 'suffices', 'without', 'loss', 'nat_norm', 'assert', 'cut', 'trivial', 'revert', 'bool_congr', 'nat_congr', 'symmetry', 'transitivity', 'auto', - 'split', 'left', 'right', 'autorewrite', 'tauto', + 'split', 'left', 'right', 'autorewrite', 'tauto', 'setoid_rewrite', + 'intuition', 'eauto', 'eapply', 'econstructor', 'etransitivity', + 'constructor', 'erewrite', 'red', 'cbv', 'lazy', 'vm_compute', + 'native_compute', 'subst', ) keywords5 = ( # Terminators 'by', 'done', 'exact', 'reflexivity', 'tauto', 'romega', 'omega', 'assumption', 'solve', 'contradiction', 'discriminate', + 'congruence', ) keywords6 = ( # Control @@ -87,15 +92,13 @@ class CoqLexer(RegexLexer): '->', r'\.', r'\.\.', ':', '::', ':=', ':>', ';', ';;', '<', '<-', '<->', '=', '>', '>]', r'>\}', r'\?', r'\?\?', r'\[', r'\[<', r'\[>', r'\[\|', ']', '_', '`', r'\{', r'\{<', r'\|', r'\|]', r'\}', '~', '=>', - r'/\\', r'\\/', + r'/\\', r'\\/', r'\{\|', r'\|\}', u'Π', u'λ', ) operators = r'[!$%&*+\./:<=>?@^|~-]' - word_operators = ('and', 'asr', 'land', 'lor', 'lsl', 'lxor', 'mod', 'or') prefix_syms = r'[!?~]' infix_syms = r'[=<>@^|&+\*/$%-]' - primitives = ('unit', 'int', 'float', 'bool', 'string', 'char', 'list', - 'array') + primitives = ('unit', 'nat', 'bool', 'string', 'ascii', 'list') tokens = { 'root': [ @@ -108,11 +111,10 @@ class CoqLexer(RegexLexer): (words(keywords4, prefix=r'\b', suffix=r'\b'), Keyword), (words(keywords5, prefix=r'\b', suffix=r'\b'), Keyword.Pseudo), (words(keywords6, prefix=r'\b', suffix=r'\b'), Keyword.Reserved), - (r'\b([A-Z][\w\']*)(?=\s*\.)', Name.Namespace, 'dotted'), - (r'\b([A-Z][\w\']*)', Name.Class), + # (r'\b([A-Z][\w\']*)(\.)', Name.Namespace, 'dotted'), + (r'\b([A-Z][\w\']*)', Name), (r'(%s)' % '|'.join(keyopts[::-1]), Operator), (r'(%s|%s)?%s' % (infix_syms, prefix_syms, operators), Operator), - (r'\b(%s)\b' % '|'.join(word_operators), Operator.Word), (r'\b(%s)\b' % '|'.join(primitives), Keyword.Type), (r"[^\W\d][\w']*", Name), @@ -130,7 +132,7 @@ class CoqLexer(RegexLexer): (r'"', String.Double, 'string'), - (r'[~?][a-z][\w\']*:', Name.Variable), + (r'[~?][a-z][\w\']*:', Name), ], 'comment': [ (r'[^(*)]+', Comment), diff --git a/tests/examplefiles/inform6_example b/tests/examplefiles/inform6_example index 73cdd087..6fa1fe5b 100644 --- a/tests/examplefiles/inform6_example +++ b/tests/examplefiles/inform6_example @@ -8,8 +8,8 @@ Switches d2SDq; Constant Story "Informal Testing"; Constant Headline "^Not a game.^";!% This is a comment, not ICL. -Release 2; -Serial "140308"; +Release 3; +Serial "151213"; Version 5; Ifndef TARGET_ZCODE; @@ -174,7 +174,8 @@ Extend 'wave' replace * -> NewWave; Extend only 'feel' 'touch' replace * noun -> Feel; -[ TestSub a b o; +[ TestSub "a\ + " b o "@@98"; ! Not an escape sequence. string 25 low_string; print "Test what?> "; table->0 = 260; |