Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/pygments/lexers/theorem.py: 96%

57 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-07-01 06:54 +0000

1""" 

2 pygments.lexers.theorem 

3 ~~~~~~~~~~~~~~~~~~~~~~~ 

4 

5 Lexers for theorem-proving languages. 

6 

7 :copyright: Copyright 2006-2023 by the Pygments team, see AUTHORS. 

8 :license: BSD, see LICENSE for details. 

9""" 

10 

11from pygments.lexer import RegexLexer, default, words 

12from pygments.token import Text, Comment, Operator, Keyword, Name, String, \ 

13 Number, Punctuation, Generic, Whitespace 

14 

15__all__ = ['CoqLexer', 'IsabelleLexer', 'LeanLexer'] 

16 

17 

18class CoqLexer(RegexLexer): 

19 """ 

20 For the Coq theorem prover. 

21 

22 .. versionadded:: 1.5 

23 """ 

24 

25 name = 'Coq' 

26 url = 'http://coq.inria.fr/' 

27 aliases = ['coq'] 

28 filenames = ['*.v'] 

29 mimetypes = ['text/x-coq'] 

30 

31 flags = 0 # no re.MULTILINE 

32 

33 keywords1 = ( 

34 # Vernacular commands 

35 'Section', 'Module', 'End', 'Require', 'Import', 'Export', 'Variable', 

36 'Variables', 'Parameter', 'Parameters', 'Axiom', 'Axioms', 'Hypothesis', 

37 'Hypotheses', 'Notation', 'Local', 'Tactic', 'Reserved', 'Scope', 

38 'Open', 'Close', 'Bind', 'Delimit', 'Definition', 'Example', 'Let', 

39 'Ltac', 'Fixpoint', 'CoFixpoint', 'Morphism', 'Relation', 'Implicit', 

40 'Arguments', 'Types', 'Unset', 'Contextual', 'Strict', 'Prenex', 

41 'Implicits', 'Inductive', 'CoInductive', 'Record', 'Structure', 

42 'Variant', 'Canonical', 'Coercion', 'Theorem', 'Lemma', 'Fact', 

43 'Remark', 'Corollary', 'Proposition', 'Property', 'Goal', 

44 'Proof', 'Restart', 'Save', 'Qed', 'Defined', 'Abort', 'Admitted', 

45 'Hint', 'Resolve', 'Rewrite', 'View', 'Search', 'Compute', 'Eval', 

46 'Show', 'Print', 'Printing', 'All', 'Graph', 'Projections', 'inside', 

47 'outside', 'Check', 'Global', 'Instance', 'Class', 'Existing', 

48 'Universe', 'Polymorphic', 'Monomorphic', 'Context', 'Scheme', 'From', 

49 'Undo', 'Fail', 'Function', 

50 ) 

51 keywords2 = ( 

52 # Gallina 

53 'forall', 'exists', 'exists2', 'fun', 'fix', 'cofix', 'struct', 

54 'match', 'end', 'in', 'return', 'let', 'if', 'is', 'then', 'else', 

55 'for', 'of', 'nosimpl', 'with', 'as', 

56 ) 

57 keywords3 = ( 

58 # Sorts 

59 'Type', 'Prop', 'SProp', 'Set', 

60 ) 

61 keywords4 = ( 

62 # Tactics 

63 'pose', 'set', 'move', 'case', 'elim', 'apply', 'clear', 'hnf', 'intro', 

64 'intros', 'generalize', 'rename', 'pattern', 'after', 'destruct', 

65 'induction', 'using', 'refine', 'inversion', 'injection', 'rewrite', 

66 'congr', 'unlock', 'compute', 'ring', 'field', 'replace', 'fold', 

67 'unfold', 'change', 'cutrewrite', 'simpl', 'have', 'suff', 'wlog', 

68 'suffices', 'without', 'loss', 'nat_norm', 'assert', 'cut', 'trivial', 

69 'revert', 'bool_congr', 'nat_congr', 'symmetry', 'transitivity', 'auto', 

70 'split', 'left', 'right', 'autorewrite', 'tauto', 'setoid_rewrite', 

71 'intuition', 'eauto', 'eapply', 'econstructor', 'etransitivity', 

72 'constructor', 'erewrite', 'red', 'cbv', 'lazy', 'vm_compute', 

73 'native_compute', 'subst', 

74 ) 

75 keywords5 = ( 

76 # Terminators 

77 'by', 'now', 'done', 'exact', 'reflexivity', 

78 'tauto', 'romega', 'omega', 'lia', 'nia', 'lra', 'nra', 'psatz', 

79 'assumption', 'solve', 'contradiction', 'discriminate', 

80 'congruence', 'admit' 

81 ) 

82 keywords6 = ( 

83 # Control 

84 'do', 'last', 'first', 'try', 'idtac', 'repeat', 

85 ) 

86 # 'as', 'assert', 'begin', 'class', 'constraint', 'do', 'done', 

87 # 'downto', 'else', 'end', 'exception', 'external', 'false', 

88 # 'for', 'fun', 'function', 'functor', 'if', 'in', 'include', 

89 # 'inherit', 'initializer', 'lazy', 'let', 'match', 'method', 

90 # 'module', 'mutable', 'new', 'object', 'of', 'open', 'private', 

91 # 'raise', 'rec', 'sig', 'struct', 'then', 'to', 'true', 'try', 

92 # 'type', 'val', 'virtual', 'when', 'while', 'with' 

93 keyopts = ( 

94 '!=', '#', '&', '&&', r'\(', r'\)', r'\*', r'\+', ',', '-', r'-\.', 

95 '->', r'\.', r'\.\.', ':', '::', ':=', ':>', ';', ';;', '<', '<-', 

96 '<->', '=', '>', '>]', r'>\}', r'\?', r'\?\?', r'\[', r'\[<', r'\[>', 

97 r'\[\|', ']', '_', '`', r'\{', r'\{<', r'\|', r'\|]', r'\}', '~', '=>', 

98 r'/\\', r'\\/', r'\{\|', r'\|\}', 

99 # 'Π', 'Σ', # Not defined in the standard library 

100 'λ', '¬', '∧', '∨', '∀', '∃', '→', '↔', '≠', '≤', '≥', 

101 ) 

102 operators = r'[!$%&*+\./:<=>?@^|~-]' 

103 prefix_syms = r'[!?~]' 

104 infix_syms = r'[=<>@^|&+\*/$%-]' 

105 

106 tokens = { 

107 'root': [ 

108 (r'\s+', Text), 

109 (r'false|true|\(\)|\[\]', Name.Builtin.Pseudo), 

110 (r'\(\*', Comment, 'comment'), 

111 (r'\b(?:[^\W\d][\w\']*\.)+[^\W\d][\w\']*\b', Name), 

112 (r'\bEquations\b\??', Keyword.Namespace), 

113 # Very weak heuristic to distinguish the Set vernacular from the Set sort 

114 (r'\bSet(?=[ \t]+[A-Z][a-z][^\n]*?\.)', Keyword.Namespace), 

115 (words(keywords1, prefix=r'\b', suffix=r'\b'), Keyword.Namespace), 

116 (words(keywords2, prefix=r'\b', suffix=r'\b'), Keyword), 

117 (words(keywords3, prefix=r'\b', suffix=r'\b'), Keyword.Type), 

118 (words(keywords4, prefix=r'\b', suffix=r'\b'), Keyword), 

119 (words(keywords5, prefix=r'\b', suffix=r'\b'), Keyword.Pseudo), 

120 (words(keywords6, prefix=r'\b', suffix=r'\b'), Keyword.Reserved), 

121 # (r'\b([A-Z][\w\']*)(\.)', Name.Namespace, 'dotted'), 

122 (r'\b([A-Z][\w\']*)', Name), 

123 (r'(%s)' % '|'.join(keyopts[::-1]), Operator), 

124 (r'(%s|%s)?%s' % (infix_syms, prefix_syms, operators), Operator), 

125 

126 (r"[^\W\d][\w']*", Name), 

127 

128 (r'\d[\d_]*', Number.Integer), 

129 (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex), 

130 (r'0[oO][0-7][0-7_]*', Number.Oct), 

131 (r'0[bB][01][01_]*', Number.Bin), 

132 (r'-?\d[\d_]*(.[\d_]*)?([eE][+\-]?\d[\d_]*)', Number.Float), 

133 

134 (r"'(?:(\\[\\\"'ntbr ])|(\\[0-9]{3})|(\\x[0-9a-fA-F]{2}))'", String.Char), 

135 

136 (r"'.'", String.Char), 

137 (r"'", Keyword), # a stray quote is another syntax element 

138 

139 (r'"', String.Double, 'string'), 

140 

141 (r'[~?][a-z][\w\']*:', Name), 

142 (r'\S', Name.Builtin.Pseudo), 

143 ], 

144 'comment': [ 

145 (r'[^(*)]+', Comment), 

146 (r'\(\*', Comment, '#push'), 

147 (r'\*\)', Comment, '#pop'), 

148 (r'[(*)]', Comment), 

149 ], 

150 'string': [ 

151 (r'[^"]+', String.Double), 

152 (r'""', String.Double), 

153 (r'"', String.Double, '#pop'), 

154 ], 

155 'dotted': [ 

156 (r'\s+', Text), 

157 (r'\.', Punctuation), 

158 (r'[A-Z][\w\']*(?=\s*\.)', Name.Namespace), 

159 (r'[A-Z][\w\']*', Name.Class, '#pop'), 

160 (r'[a-z][a-z0-9_\']*', Name, '#pop'), 

161 default('#pop') 

162 ], 

163 } 

164 

165 def analyse_text(text): 

166 if 'Qed' in text and 'Proof' in text: 

167 return 1 

168 

169 

170class IsabelleLexer(RegexLexer): 

171 """ 

172 For the Isabelle proof assistant. 

173 

174 .. versionadded:: 2.0 

175 """ 

176 

177 name = 'Isabelle' 

178 url = 'https://isabelle.in.tum.de/' 

179 aliases = ['isabelle'] 

180 filenames = ['*.thy'] 

181 mimetypes = ['text/x-isabelle'] 

182 

183 keyword_minor = ( 

184 'and', 'assumes', 'attach', 'avoids', 'binder', 'checking', 

185 'class_instance', 'class_relation', 'code_module', 'congs', 

186 'constant', 'constrains', 'datatypes', 'defines', 'file', 'fixes', 

187 'for', 'functions', 'hints', 'identifier', 'if', 'imports', 'in', 

188 'includes', 'infix', 'infixl', 'infixr', 'is', 'keywords', 'lazy', 

189 'module_name', 'monos', 'morphisms', 'no_discs_sels', 'notes', 

190 'obtains', 'open', 'output', 'overloaded', 'parametric', 'permissive', 

191 'pervasive', 'rep_compat', 'shows', 'structure', 'type_class', 

192 'type_constructor', 'unchecked', 'unsafe', 'where', 

193 ) 

194 

195 keyword_diag = ( 

196 'ML_command', 'ML_val', 'class_deps', 'code_deps', 'code_thms', 

197 'display_drafts', 'find_consts', 'find_theorems', 'find_unused_assms', 

198 'full_prf', 'help', 'locale_deps', 'nitpick', 'pr', 'prf', 

199 'print_abbrevs', 'print_antiquotations', 'print_attributes', 

200 'print_binds', 'print_bnfs', 'print_bundles', 

201 'print_case_translations', 'print_cases', 'print_claset', 

202 'print_classes', 'print_codeproc', 'print_codesetup', 

203 'print_coercions', 'print_commands', 'print_context', 

204 'print_defn_rules', 'print_dependencies', 'print_facts', 

205 'print_induct_rules', 'print_inductives', 'print_interps', 

206 'print_locale', 'print_locales', 'print_methods', 'print_options', 

207 'print_orders', 'print_quot_maps', 'print_quotconsts', 

208 'print_quotients', 'print_quotientsQ3', 'print_quotmapsQ3', 

209 'print_rules', 'print_simpset', 'print_state', 'print_statement', 

210 'print_syntax', 'print_theorems', 'print_theory', 'print_trans_rules', 

211 'prop', 'pwd', 'quickcheck', 'refute', 'sledgehammer', 'smt_status', 

212 'solve_direct', 'spark_status', 'term', 'thm', 'thm_deps', 'thy_deps', 

213 'try', 'try0', 'typ', 'unused_thms', 'value', 'values', 'welcome', 

214 'print_ML_antiquotations', 'print_term_bindings', 'values_prolog', 

215 ) 

216 

217 keyword_thy = ('theory', 'begin', 'end') 

218 

219 keyword_section = ('header', 'chapter') 

220 

221 keyword_subsection = ( 

222 'section', 'subsection', 'subsubsection', 'sect', 'subsect', 

223 'subsubsect', 

224 ) 

225 

226 keyword_theory_decl = ( 

227 'ML', 'ML_file', 'abbreviation', 'adhoc_overloading', 'arities', 

228 'atom_decl', 'attribute_setup', 'axiomatization', 'bundle', 

229 'case_of_simps', 'class', 'classes', 'classrel', 'codatatype', 

230 'code_abort', 'code_class', 'code_const', 'code_datatype', 

231 'code_identifier', 'code_include', 'code_instance', 'code_modulename', 

232 'code_monad', 'code_printing', 'code_reflect', 'code_reserved', 

233 'code_type', 'coinductive', 'coinductive_set', 'consts', 'context', 

234 'datatype', 'datatype_new', 'datatype_new_compat', 'declaration', 

235 'declare', 'default_sort', 'defer_recdef', 'definition', 'defs', 

236 'domain', 'domain_isomorphism', 'domaindef', 'equivariance', 

237 'export_code', 'extract', 'extract_type', 'fixrec', 'fun', 

238 'fun_cases', 'hide_class', 'hide_const', 'hide_fact', 'hide_type', 

239 'import_const_map', 'import_file', 'import_tptp', 'import_type_map', 

240 'inductive', 'inductive_set', 'instantiation', 'judgment', 'lemmas', 

241 'lifting_forget', 'lifting_update', 'local_setup', 'locale', 

242 'method_setup', 'nitpick_params', 'no_adhoc_overloading', 

243 'no_notation', 'no_syntax', 'no_translations', 'no_type_notation', 

244 'nominal_datatype', 'nonterminal', 'notation', 'notepad', 'oracle', 

245 'overloading', 'parse_ast_translation', 'parse_translation', 

246 'partial_function', 'primcorec', 'primrec', 'primrec_new', 

247 'print_ast_translation', 'print_translation', 'quickcheck_generator', 

248 'quickcheck_params', 'realizability', 'realizers', 'recdef', 'record', 

249 'refute_params', 'setup', 'setup_lifting', 'simproc_setup', 

250 'simps_of_case', 'sledgehammer_params', 'spark_end', 'spark_open', 

251 'spark_open_siv', 'spark_open_vcg', 'spark_proof_functions', 

252 'spark_types', 'statespace', 'syntax', 'syntax_declaration', 'text', 

253 'text_raw', 'theorems', 'translations', 'type_notation', 

254 'type_synonym', 'typed_print_translation', 'typedecl', 'hoarestate', 

255 'install_C_file', 'install_C_types', 'wpc_setup', 'c_defs', 'c_types', 

256 'memsafe', 'SML_export', 'SML_file', 'SML_import', 'approximate', 

257 'bnf_axiomatization', 'cartouche', 'datatype_compat', 

258 'free_constructors', 'functor', 'nominal_function', 

259 'nominal_termination', 'permanent_interpretation', 

260 'binds', 'defining', 'smt2_status', 'term_cartouche', 

261 'boogie_file', 'text_cartouche', 

262 ) 

263 

264 keyword_theory_script = ('inductive_cases', 'inductive_simps') 

265 

266 keyword_theory_goal = ( 

267 'ax_specification', 'bnf', 'code_pred', 'corollary', 'cpodef', 

268 'crunch', 'crunch_ignore', 

269 'enriched_type', 'function', 'instance', 'interpretation', 'lemma', 

270 'lift_definition', 'nominal_inductive', 'nominal_inductive2', 

271 'nominal_primrec', 'pcpodef', 'primcorecursive', 

272 'quotient_definition', 'quotient_type', 'recdef_tc', 'rep_datatype', 

273 'schematic_corollary', 'schematic_lemma', 'schematic_theorem', 

274 'spark_vc', 'specification', 'subclass', 'sublocale', 'termination', 

275 'theorem', 'typedef', 'wrap_free_constructors', 

276 ) 

277 

278 keyword_qed = ('by', 'done', 'qed') 

279 keyword_abandon_proof = ('sorry', 'oops') 

280 

281 keyword_proof_goal = ('have', 'hence', 'interpret') 

282 

283 keyword_proof_block = ('next', 'proof') 

284 

285 keyword_proof_chain = ( 

286 'finally', 'from', 'then', 'ultimately', 'with', 

287 ) 

288 

289 keyword_proof_decl = ( 

290 'ML_prf', 'also', 'include', 'including', 'let', 'moreover', 'note', 

291 'txt', 'txt_raw', 'unfolding', 'using', 'write', 

292 ) 

293 

294 keyword_proof_asm = ('assume', 'case', 'def', 'fix', 'presume') 

295 

296 keyword_proof_asm_goal = ('guess', 'obtain', 'show', 'thus') 

297 

298 keyword_proof_script = ( 

299 'apply', 'apply_end', 'apply_trace', 'back', 'defer', 'prefer', 

300 ) 

301 

302 operators = ( 

303 '::', ':', '(', ')', '[', ']', '_', '=', ',', '|', 

304 '+', '-', '!', '?', 

305 ) 

306 

307 proof_operators = ('{', '}', '.', '..') 

308 

309 tokens = { 

310 'root': [ 

311 (r'\s+', Whitespace), 

312 (r'\(\*', Comment, 'comment'), 

313 (r'\\<open>', String.Symbol, 'cartouche'), 

314 (r'\{\*|‹', String, 'cartouche'), 

315 

316 (words(operators), Operator), 

317 (words(proof_operators), Operator.Word), 

318 

319 (words(keyword_minor, prefix=r'\b', suffix=r'\b'), Keyword.Pseudo), 

320 

321 (words(keyword_diag, prefix=r'\b', suffix=r'\b'), Keyword.Type), 

322 

323 (words(keyword_thy, prefix=r'\b', suffix=r'\b'), Keyword), 

324 (words(keyword_theory_decl, prefix=r'\b', suffix=r'\b'), Keyword), 

325 

326 (words(keyword_section, prefix=r'\b', suffix=r'\b'), Generic.Heading), 

327 (words(keyword_subsection, prefix=r'\b', suffix=r'\b'), Generic.Subheading), 

328 

329 (words(keyword_theory_goal, prefix=r'\b', suffix=r'\b'), Keyword.Namespace), 

330 (words(keyword_theory_script, prefix=r'\b', suffix=r'\b'), Keyword.Namespace), 

331 

332 (words(keyword_abandon_proof, prefix=r'\b', suffix=r'\b'), Generic.Error), 

333 

334 (words(keyword_qed, prefix=r'\b', suffix=r'\b'), Keyword), 

335 (words(keyword_proof_goal, prefix=r'\b', suffix=r'\b'), Keyword), 

336 (words(keyword_proof_block, prefix=r'\b', suffix=r'\b'), Keyword), 

337 (words(keyword_proof_decl, prefix=r'\b', suffix=r'\b'), Keyword), 

338 

339 (words(keyword_proof_chain, prefix=r'\b', suffix=r'\b'), Keyword), 

340 (words(keyword_proof_asm, prefix=r'\b', suffix=r'\b'), Keyword), 

341 (words(keyword_proof_asm_goal, prefix=r'\b', suffix=r'\b'), Keyword), 

342 

343 (words(keyword_proof_script, prefix=r'\b', suffix=r'\b'), Keyword.Pseudo), 

344 

345 (r'\\<(\w|\^)*>', Text.Symbol), 

346 

347 (r"'[^\W\d][.\w']*", Name.Type), 

348 

349 (r'0[xX][\da-fA-F][\da-fA-F_]*', Number.Hex), 

350 (r'0[oO][0-7][0-7_]*', Number.Oct), 

351 (r'0[bB][01][01_]*', Number.Bin), 

352 

353 (r'"', String, 'string'), 

354 (r'`', String.Other, 'fact'), 

355 (r'[^\s:|\[\]\-()=,+!?{}._][^\s:|\[\]\-()=,+!?{}]*', Name), 

356 ], 

357 'comment': [ 

358 (r'[^(*)]+', Comment), 

359 (r'\(\*', Comment, '#push'), 

360 (r'\*\)', Comment, '#pop'), 

361 (r'[(*)]', Comment), 

362 ], 

363 'cartouche': [ 

364 (r'[^{*}\\‹›]+', String), 

365 (r'\\<open>', String.Symbol, '#push'), 

366 (r'\{\*|‹', String, '#push'), 

367 (r'\\<close>', String.Symbol, '#pop'), 

368 (r'\*\}|›', String, '#pop'), 

369 (r'\\<(\w|\^)*>', String.Symbol), 

370 (r'[{*}\\]', String), 

371 ], 

372 'string': [ 

373 (r'[^"\\]+', String), 

374 (r'\\<(\w|\^)*>', String.Symbol), 

375 (r'\\"', String), 

376 (r'\\', String), 

377 (r'"', String, '#pop'), 

378 ], 

379 'fact': [ 

380 (r'[^`\\]+', String.Other), 

381 (r'\\<(\w|\^)*>', String.Symbol), 

382 (r'\\`', String.Other), 

383 (r'\\', String.Other), 

384 (r'`', String.Other, '#pop'), 

385 ], 

386 } 

387 

388 

389class LeanLexer(RegexLexer): 

390 """ 

391 For the Lean theorem prover. 

392 

393 .. versionadded:: 2.0 

394 """ 

395 name = 'Lean' 

396 url = 'https://github.com/leanprover/lean' 

397 aliases = ['lean'] 

398 filenames = ['*.lean'] 

399 mimetypes = ['text/x-lean'] 

400 

401 tokens = { 

402 'root': [ 

403 (r'\s+', Text), 

404 (r'/--', String.Doc, 'docstring'), 

405 (r'/-', Comment, 'comment'), 

406 (r'--.*?$', Comment.Single), 

407 (words(( 

408 'import', 'renaming', 'hiding', 

409 'namespace', 

410 'local', 

411 'private', 'protected', 'section', 

412 'include', 'omit', 'section', 

413 'protected', 'export', 

414 'open', 

415 'attribute', 

416 ), prefix=r'\b', suffix=r'\b'), Keyword.Namespace), 

417 (words(( 

418 'lemma', 'theorem', 'def', 'definition', 'example', 

419 'axiom', 'axioms', 'constant', 'constants', 

420 'universe', 'universes', 

421 'inductive', 'coinductive', 'structure', 'extends', 

422 'class', 'instance', 

423 'abbreviation', 

424 

425 'noncomputable theory', 

426 

427 'noncomputable', 'mutual', 'meta', 

428 

429 'attribute', 

430 

431 'parameter', 'parameters', 

432 'variable', 'variables', 

433 

434 'reserve', 'precedence', 

435 'postfix', 'prefix', 'notation', 'infix', 'infixl', 'infixr', 

436 

437 'begin', 'by', 'end', 

438 

439 'set_option', 

440 'run_cmd', 

441 ), prefix=r'\b', suffix=r'\b'), Keyword.Declaration), 

442 (r'@\[[^\]]*\]', Keyword.Declaration), 

443 (words(( 

444 'forall', 'fun', 'Pi', 'from', 'have', 'show', 'assume', 'suffices', 

445 'let', 'if', 'else', 'then', 'in', 'with', 'calc', 'match', 

446 'do' 

447 ), prefix=r'\b', suffix=r'\b'), Keyword), 

448 (words(('sorry', 'admit'), prefix=r'\b', suffix=r'\b'), Generic.Error), 

449 (words(('Sort', 'Prop', 'Type'), prefix=r'\b', suffix=r'\b'), Keyword.Type), 

450 (words(( 

451 '#eval', '#check', '#reduce', '#exit', 

452 '#print', '#help', 

453 ), suffix=r'\b'), Keyword), 

454 (words(( 

455 '(', ')', ':', '{', '}', '[', ']', '⟨', '⟩', '‹', '›', '⦃', '⦄', ':=', ',', 

456 )), Operator), 

457 (r'[A-Za-z_\u03b1-\u03ba\u03bc-\u03fb\u1f00-\u1ffe\u2100-\u214f]' 

458 r'[.A-Za-z_\'\u03b1-\u03ba\u03bc-\u03fb\u1f00-\u1ffe\u2070-\u2079' 

459 r'\u207f-\u2089\u2090-\u209c\u2100-\u214f0-9]*', Name), 

460 (r'0x[A-Za-z0-9]+', Number.Integer), 

461 (r'0b[01]+', Number.Integer), 

462 (r'\d+', Number.Integer), 

463 (r'"', String.Double, 'string'), 

464 (r"'(?:(\\[\\\"'nt])|(\\x[0-9a-fA-F]{2})|(\\u[0-9a-fA-F]{4})|.)'", String.Char), 

465 (r'[~?][a-z][\w\']*:', Name.Variable), 

466 (r'\S', Name.Builtin.Pseudo), 

467 ], 

468 'comment': [ 

469 (r'[^/-]', Comment.Multiline), 

470 (r'/-', Comment.Multiline, '#push'), 

471 (r'-/', Comment.Multiline, '#pop'), 

472 (r'[/-]', Comment.Multiline) 

473 ], 

474 'docstring': [ 

475 (r'[^/-]', String.Doc), 

476 (r'-/', String.Doc, '#pop'), 

477 (r'[/-]', String.Doc) 

478 ], 

479 'string': [ 

480 (r'[^\\"]+', String.Double), 

481 (r"(?:(\\[\\\"'nt])|(\\x[0-9a-fA-F]{2})|(\\u[0-9a-fA-F]{4}))", String.Escape), 

482 ('"', String.Double, '#pop'), 

483 ], 

484 }