eric6/ThirdParty/Pygments/pygments/lexers/lisp.py

changeset 7983
54c5cfbb1e29
parent 7701
25f42e208e08
equal deleted inserted replaced
7982:48d210e41c65 7983:54c5cfbb1e29
3 pygments.lexers.lisp 3 pygments.lexers.lisp
4 ~~~~~~~~~~~~~~~~~~~~ 4 ~~~~~~~~~~~~~~~~~~~~
5 5
6 Lexers for Lispy languages. 6 Lexers for Lispy languages.
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
117 # support for uncommon kinds of numbers - 117 # support for uncommon kinds of numbers -
118 # have to figure out what the characters mean 118 # have to figure out what the characters mean
119 # (r'(#e|#i|#b|#o|#d|#x)[\d.]+', Number), 119 # (r'(#e|#i|#b|#o|#d|#x)[\d.]+', Number),
120 120
121 # strings, symbols and characters 121 # strings, symbols and characters
122 (r'"(\\\\|\\"|[^"])*"', String), 122 (r'"(\\\\|\\[^\\]|[^"\\])*"', String),
123 (r"'" + valid_name, String.Symbol), 123 (r"'" + valid_name, String.Symbol),
124 (r"#\\([()/'\"._!§$%& ?=+-]|[a-zA-Z0-9]+)", String.Char), 124 (r"#\\([()/'\"._!§$%& ?=+-]|[a-zA-Z0-9]+)", String.Char),
125 125
126 # constants 126 # constants
127 (r'(#t|#f)', Name.Constant), 127 (r'(#t|#f)', Name.Constant),
401 (r'-?\d+', Number.Integer), 401 (r'-?\d+', Number.Integer),
402 (r'0[0-7]+j?', Number.Oct), 402 (r'0[0-7]+j?', Number.Oct),
403 (r'0[xX][a-fA-F0-9]+', Number.Hex), 403 (r'0[xX][a-fA-F0-9]+', Number.Hex),
404 404
405 # strings, symbols and characters 405 # strings, symbols and characters
406 (r'"(\\\\|\\"|[^"])*"', String), 406 (r'"(\\\\|\\[^\\]|[^"\\])*"', String),
407 (r"'" + valid_name, String.Symbol), 407 (r"'" + valid_name, String.Symbol),
408 (r"\\(.|[a-z]+)", String.Char), 408 (r"\\(.|[a-z]+)", String.Char),
409 (r'^(\s*)([rRuU]{,2}"""(?:.|\n)*?""")', bygroups(Text, String.Doc)), 409 (r'^(\s*)([rRuU]{,2}"""(?:.|\n)*?""")', bygroups(Text, String.Doc)),
410 (r"^(\s*)([rRuU]{,2}'''(?:.|\n)*?''')", bygroups(Text, String.Doc)), 410 (r"^(\s*)([rRuU]{,2}'''(?:.|\n)*?''')", bygroups(Text, String.Doc)),
411 411
1488 1488
1489 # whitespace 1489 # whitespace
1490 (r'\s+', Text), 1490 (r'\s+', Text),
1491 1491
1492 # strings, symbols and characters 1492 # strings, symbols and characters
1493 (r'"(\\\\|\\"|[^"])*"', String), 1493 (r'"(\\\\|\\[^\\]|[^"\\])*"', String),
1494 1494
1495 # braces 1495 # braces
1496 (r'\{', String, "bracestring"), 1496 (r'\{', String, "bracestring"),
1497 1497
1498 # [text] ... [/text] delimited strings 1498 # [text] ... [/text] delimited strings
2381 # support for uncommon kinds of numbers - 2381 # support for uncommon kinds of numbers -
2382 # have to figure out what the characters mean 2382 # have to figure out what the characters mean
2383 # (r'(#e|#i|#b|#o|#d|#x)[\d.]+', Number), 2383 # (r'(#e|#i|#b|#o|#d|#x)[\d.]+', Number),
2384 2384
2385 # strings, symbols and characters 2385 # strings, symbols and characters
2386 (r'"(\\\\|\\"|[^"])*"', String), 2386 (r'"(\\\\|\\[^\\]|[^"\\])*"', String),
2387 (r"'" + valid_name, String.Symbol), 2387 (r"'" + valid_name, String.Symbol),
2388 (r"#\\([()/'\"._!§$%& ?=+-]|[a-zA-Z0-9]+)", String.Char), 2388 (r"#\\([()/'\"._!§$%& ?=+-]|[a-zA-Z0-9]+)", String.Char),
2389 2389
2390 # constants 2390 # constants
2391 (r'(#t|#f)', Name.Constant), 2391 (r'(#t|#f)', Name.Constant),
2594 2594
2595 # binary/oct/hex literals 2595 # binary/oct/hex literals
2596 (r'(#b|#o|#x)[\d.]+', Number), 2596 (r'(#b|#o|#x)[\d.]+', Number),
2597 2597
2598 # strings 2598 # strings
2599 (r'"(\\\\|\\"|[^"])*"', String), 2599 (r'"(\\\\|\\[^\\]|[^"\\])*"', String),
2600 2600
2601 # true/false constants 2601 # true/false constants
2602 (r'(#t|#f)', Name.Constant), 2602 (r'(#t|#f)', Name.Constant),
2603 2603
2604 # keywords 2604 # keywords
2670 2670
2671 (r'[,\s]+', Text), 2671 (r'[,\s]+', Text),
2672 (r'-?\d+\.\d+', Number.Float), 2672 (r'-?\d+\.\d+', Number.Float),
2673 (r'-?\d+', Number.Integer), 2673 (r'-?\d+', Number.Integer),
2674 2674
2675 (r'"(\\\\|\\"|\\|[^"\\])*"', String), 2675 (r'"(\\\\|\\[^\\]|[^"\\])*"', String),
2676 2676
2677 # these are technically strings, but it's worth visually 2677 # these are technically strings, but it's worth visually
2678 # distinguishing them because their intent is different 2678 # distinguishing them because their intent is different
2679 # from regular strings. 2679 # from regular strings.
2680 (r':' + valid_name, String.Symbol), 2680 (r':' + valid_name, String.Symbol),

eric ide

mercurial