3 pygments.lexers.webmisc |
3 pygments.lexers.webmisc |
4 ~~~~~~~~~~~~~~~~~~~~~~~ |
4 ~~~~~~~~~~~~~~~~~~~~~~~ |
5 |
5 |
6 Lexers for misc. web stuff. |
6 Lexers for misc. web stuff. |
7 |
7 |
8 :copyright: Copyright 2006-2020 by the Pygments team, see AUTHORS. |
8 :copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS. |
9 :license: BSD, see LICENSE for details. |
9 :license: BSD, see LICENSE for details. |
10 """ |
10 """ |
11 |
11 |
12 import re |
12 import re |
13 |
13 |
126 ctx.stack = ['root'] |
126 ctx.stack = ['root'] |
127 ctx.pos = match.end() |
127 ctx.pos = match.end() |
128 |
128 |
129 def popstate_tag_callback(lexer, match, ctx): |
129 def popstate_tag_callback(lexer, match, ctx): |
130 yield match.start(), Name.Tag, match.group(1) |
130 yield match.start(), Name.Tag, match.group(1) |
131 ctx.stack.append(lexer.xquery_parse_state.pop()) |
131 if lexer.xquery_parse_state: |
|
132 ctx.stack.append(lexer.xquery_parse_state.pop()) |
132 ctx.pos = match.end() |
133 ctx.pos = match.end() |
133 |
134 |
134 def popstate_xmlcomment_callback(lexer, match, ctx): |
135 def popstate_xmlcomment_callback(lexer, match, ctx): |
135 yield match.start(), String.Doc, match.group(1) |
136 yield match.start(), String.Doc, match.group(1) |
136 ctx.stack.append(lexer.xquery_parse_state.pop()) |
137 ctx.stack.append(lexer.xquery_parse_state.pop()) |
855 r'window)\b', Name.Builtin), |
856 r'window)\b', Name.Builtin), |
856 (r'[$a-zA-Z_]\w*', Name.Other), |
857 (r'[$a-zA-Z_]\w*', Name.Other), |
857 (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), |
858 (r'[0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?', Number.Float), |
858 (r'0x[0-9a-fA-F]+', Number.Hex), |
859 (r'0x[0-9a-fA-F]+', Number.Hex), |
859 (r'[0-9]+', Number.Integer), |
860 (r'[0-9]+', Number.Integer), |
860 (r'"(\\\\|\\"|[^"])*"', String.Double), |
861 (r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double), |
861 (r"'(\\\\|\\'|[^'])*'", String.Single), |
862 (r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single), |
862 ] |
863 ] |
863 } |
864 } |
864 |
865 |
865 |
866 |
866 class CirruLexer(RegexLexer): |
867 class CirruLexer(RegexLexer): |