aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/tools/cython/Cython/Compiler/Lexicon.py
diff options
context:
space:
mode:
authororivej <orivej@yandex-team.ru>2022-02-10 16:45:01 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:01 +0300
commit2d37894b1b037cf24231090eda8589bbb44fb6fc (patch)
treebe835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/tools/cython/Cython/Compiler/Lexicon.py
parent718c552901d703c502ccbefdfc3c9028d608b947 (diff)
downloadydb-2d37894b1b037cf24231090eda8589bbb44fb6fc.tar.gz
Restoring authorship annotation for <orivej@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/tools/cython/Cython/Compiler/Lexicon.py')
-rw-r--r--contrib/tools/cython/Cython/Compiler/Lexicon.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/contrib/tools/cython/Cython/Compiler/Lexicon.py b/contrib/tools/cython/Cython/Compiler/Lexicon.py
index f88cfa8d5a..72c9ceaefd 100644
--- a/contrib/tools/cython/Cython/Compiler/Lexicon.py
+++ b/contrib/tools/cython/Cython/Compiler/Lexicon.py
@@ -3,11 +3,11 @@
# Cython Scanner - Lexical Definitions
#
-from __future__ import absolute_import, unicode_literals
+from __future__ import absolute_import, unicode_literals
raw_prefixes = "rR"
bytes_prefixes = "bB"
-string_prefixes = "fFuU" + bytes_prefixes
+string_prefixes = "fFuU" + bytes_prefixes
char_prefixes = "cC"
any_string_prefix = raw_prefixes + string_prefixes + char_prefixes
IDENT = 'IDENT'
@@ -26,25 +26,25 @@ def make_lexicon():
hexdigit = Any("0123456789ABCDEFabcdef")
indentation = Bol + Rep(Any(" \t"))
- def underscore_digits(d):
- return Rep1(d) + Rep(Str("_") + Rep1(d))
-
- decimal = underscore_digits(digit)
+ def underscore_digits(d):
+ return Rep1(d) + Rep(Str("_") + Rep1(d))
+
+ decimal = underscore_digits(digit)
dot = Str(".")
exponent = Any("Ee") + Opt(Any("+-")) + decimal
decimal_fract = (decimal + dot + Opt(decimal)) | (dot + decimal)
name = letter + Rep(letter | digit)
- intconst = decimal | (Str("0") + ((Any("Xx") + underscore_digits(hexdigit)) |
- (Any("Oo") + underscore_digits(octdigit)) |
- (Any("Bb") + underscore_digits(bindigit)) ))
+ intconst = decimal | (Str("0") + ((Any("Xx") + underscore_digits(hexdigit)) |
+ (Any("Oo") + underscore_digits(octdigit)) |
+ (Any("Bb") + underscore_digits(bindigit)) ))
intsuffix = (Opt(Any("Uu")) + Opt(Any("Ll")) + Opt(Any("Ll"))) | (Opt(Any("Ll")) + Opt(Any("Ll")) + Opt(Any("Uu")))
intliteral = intconst + intsuffix
fltconst = (decimal_fract + Opt(exponent)) | (decimal + exponent)
imagconst = (intconst | fltconst) + Any("jJ")
- # invalid combinations of prefixes are caught in p_string_literal
- beginstring = Opt(Rep(Any(string_prefixes + raw_prefixes)) |
+ # invalid combinations of prefixes are caught in p_string_literal
+ beginstring = Opt(Rep(Any(string_prefixes + raw_prefixes)) |
Any(char_prefixes)
) + (Str("'") | Str('"') | Str("'''") | Str('"""'))
two_oct = octdigit + octdigit
@@ -70,9 +70,9 @@ def make_lexicon():
return Lexicon([
(name, IDENT),
- (intliteral, Method('strip_underscores', symbol='INT')),
- (fltconst, Method('strip_underscores', symbol='FLOAT')),
- (imagconst, Method('strip_underscores', symbol='IMAG')),
+ (intliteral, Method('strip_underscores', symbol='INT')),
+ (fltconst, Method('strip_underscores', symbol='FLOAT')),
+ (imagconst, Method('strip_underscores', symbol='IMAG')),
(punct | diphthong, TEXT),
(bra, Method('open_bracket_action')),