diff options
author | shadchin <shadchin@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:44:30 +0300 |
commit | 2598ef1d0aee359b4b6d5fdd1758916d5907d04f (patch) | |
tree | 012bb94d777798f1f56ac1cec429509766d05181 /contrib/tools/python3/src/Lib/lib2to3/pgen2 | |
parent | 6751af0b0c1b952fede40b19b71da8025b5d8bcf (diff) | |
download | ydb-2598ef1d0aee359b4b6d5fdd1758916d5907d04f.tar.gz |
Restoring authorship annotation for <shadchin@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/tools/python3/src/Lib/lib2to3/pgen2')
4 files changed, 15 insertions, 15 deletions
diff --git a/contrib/tools/python3/src/Lib/lib2to3/pgen2/grammar.py b/contrib/tools/python3/src/Lib/lib2to3/pgen2/grammar.py index 6a4d575ac2..bddf785dbb 100644 --- a/contrib/tools/python3/src/Lib/lib2to3/pgen2/grammar.py +++ b/contrib/tools/python3/src/Lib/lib2to3/pgen2/grammar.py @@ -85,9 +85,9 @@ class Grammar(object): self.start = 256 def dump(self, filename): - """Dump the grammar tables to a pickle file.""" + """Dump the grammar tables to a pickle file.""" with open(filename, "wb") as f: - pickle.dump(self.__dict__, f, pickle.HIGHEST_PROTOCOL) + pickle.dump(self.__dict__, f, pickle.HIGHEST_PROTOCOL) def load(self, filename): """Load the grammar tables from a pickle file.""" @@ -178,7 +178,7 @@ opmap_raw = """ // DOUBLESLASH //= DOUBLESLASHEQUAL -> RARROW -:= COLONEQUAL +:= COLONEQUAL """ opmap = {} diff --git a/contrib/tools/python3/src/Lib/lib2to3/pgen2/parse.py b/contrib/tools/python3/src/Lib/lib2to3/pgen2/parse.py index cf3fcf7e99..1b6117174e 100644 --- a/contrib/tools/python3/src/Lib/lib2to3/pgen2/parse.py +++ b/contrib/tools/python3/src/Lib/lib2to3/pgen2/parse.py @@ -24,9 +24,9 @@ class ParseError(Exception): self.value = value self.context = context - def __reduce__(self): - return type(self), (self.msg, self.type, self.value, self.context) - + def __reduce__(self): + return type(self), (self.msg, self.type, self.value, self.context) + class Parser(object): """Parser engine. diff --git a/contrib/tools/python3/src/Lib/lib2to3/pgen2/token.py b/contrib/tools/python3/src/Lib/lib2to3/pgen2/token.py index 5f6612f5b3..1ab43f697d 100644 --- a/contrib/tools/python3/src/Lib/lib2to3/pgen2/token.py +++ b/contrib/tools/python3/src/Lib/lib2to3/pgen2/token.py @@ -65,8 +65,8 @@ RARROW = 55 AWAIT = 56 ASYNC = 57 ERRORTOKEN = 58 -COLONEQUAL = 59 -N_TOKENS = 60 +COLONEQUAL = 59 +N_TOKENS = 60 NT_OFFSET = 256 #--end constants-- diff --git a/contrib/tools/python3/src/Lib/lib2to3/pgen2/tokenize.py b/contrib/tools/python3/src/Lib/lib2to3/pgen2/tokenize.py index 099dfa7798..19db93a72d 100644 --- a/contrib/tools/python3/src/Lib/lib2to3/pgen2/tokenize.py +++ b/contrib/tools/python3/src/Lib/lib2to3/pgen2/tokenize.py @@ -93,7 +93,7 @@ Operator = group(r"\*\*=?", r">>=?", r"<<=?", r"<>", r"!=", r"~") Bracket = '[][(){}]' -Special = group(r'\r?\n', r':=', r'[:;.,`@]') +Special = group(r'\r?\n', r':=', r'[:;.,`@]') Funny = group(Operator, Bracket, Special) PlainToken = group(Number, Funny, String, Name) @@ -321,7 +321,7 @@ def untokenize(iterable): Round-trip invariant for full input: Untokenized source will match input source exactly - Round-trip invariant for limited input: + Round-trip invariant for limited input: # Output text will tokenize the back to the input t1 = [tok[:2] for tok in generate_tokens(f.readline)] newcode = untokenize(t1) @@ -346,7 +346,7 @@ def generate_tokens(readline): column where the token begins in the source; a 2-tuple (erow, ecol) of ints specifying the row and column where the token ends in the source; and the line on which the token was found. The line passed is the - physical line. + physical line. """ lnum = parenlev = continued = 0 contstr, needcont = '', 0 @@ -512,14 +512,14 @@ def generate_tokens(readline): stashed = tok continue - if token in ('def', 'for'): + if token in ('def', 'for'): if (stashed and stashed[0] == NAME and stashed[1] == 'async'): - if token == 'def': - async_def = True - async_def_indent = indents[-1] + if token == 'def': + async_def = True + async_def_indent = indents[-1] yield (ASYNC, stashed[1], stashed[2], stashed[3], |