Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2eca440

Browse files
committed
Get rid of some more cases of backquotes. parsermodule.c doesn't compile
but looks like that was a problem before this change.
1 parent 3bd844e commit 2eca440

6 files changed

Lines changed: 3 additions & 17 deletions

File tree

Doc/lib/asttable.tex

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
\lineiii{}{\member{expr}}{}
3737
\hline
3838

39-
\lineiii{Backquote}{\member{expr}}{}
40-
\hline
41-
4239
\lineiii{Bitand}{\member{nodes}}{}
4340
\hline
4441

Include/token.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extern "C" {
3232
#define EQUAL 22
3333
#define DOT 23
3434
#define PERCENT 24
35-
#define BACKQUOTE 25
35+
/* #define BACKQUOTE 25 */
3636
#define LBRACE 26
3737
#define RBRACE 27
3838
#define EQEQUAL 28

Lib/compiler/transformer.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ def __init__(self):
111111
self._atom_dispatch = {token.LPAR: self.atom_lpar,
112112
token.LSQB: self.atom_lsqb,
113113
token.LBRACE: self.atom_lbrace,
114-
token.BACKQUOTE: self.atom_backquote,
115114
token.NUMBER: self.atom_number,
116115
token.STRING: self.atom_string,
117116
token.NAME: self.atom_name,
@@ -740,9 +739,6 @@ def atom_lbrace(self, nodelist):
740739
return Dict((), lineno=nodelist[0][2])
741740
return self.com_dictsetmaker(nodelist[1])
742741

743-
def atom_backquote(self, nodelist):
744-
return Backquote(self.com_node(nodelist[1]))
745-
746742
def atom_number(self, nodelist):
747743
### need to verify this matches compile.c
748744
k = eval(nodelist[0][1])

Lib/pydoc.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,7 @@ class Helper:
15641564
'CLASSES': ('ref/types', 'class SPECIALMETHODS PRIVATENAMES'),
15651565
'MODULES': ('lib/typesmodules', 'import'),
15661566
'PACKAGES': 'import',
1567-
'EXPRESSIONS': ('ref/summary', 'lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIES BACKQUOTES'),
1567+
'EXPRESSIONS': ('ref/summary', 'lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIES'),
15681568
'OPERATORS': 'EXPRESSIONS',
15691569
'PRECEDENCE': 'EXPRESSIONS',
15701570
'OBJECTS': ('ref/objects', 'TYPES'),
@@ -1587,14 +1587,13 @@ class Helper:
15871587
'IDENTIFIERS': ('ref/identifiers', 'keywords SPECIALIDENTIFIERS'),
15881588
'SPECIALIDENTIFIERS': ('ref/id-classes', ''),
15891589
'PRIVATENAMES': ('ref/atom-identifiers', ''),
1590-
'LITERALS': ('ref/atom-literals', 'STRINGS BACKQUOTES NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS'),
1590+
'LITERALS': ('ref/atom-literals', 'STRINGS NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS'),
15911591
'TUPLES': 'SEQUENCES',
15921592
'TUPLELITERALS': ('ref/exprlists', 'TUPLES LITERALS'),
15931593
'LISTS': ('lib/typesseq-mutable', 'LISTLITERALS'),
15941594
'LISTLITERALS': ('ref/lists', 'LISTS LITERALS'),
15951595
'DICTIONARIES': ('lib/typesmapping', 'DICTIONARYLITERALS'),
15961596
'DICTIONARYLITERALS': ('ref/dict', 'DICTIONARIES LITERALS'),
1597-
'BACKQUOTES': ('ref/string-conversions', 'repr str STRINGS LITERALS'),
15981597
'ATTRIBUTES': ('ref/attribute-references', 'getattr hasattr setattr ATTRIBUTEMETHODS'),
15991598
'SUBSCRIPTS': ('ref/subscriptions', 'SEQUENCEMETHODS1'),
16001599
'SLICINGS': ('ref/slicings', 'SEQUENCEMETHODS2'),

Lib/token.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
EQUAL = 22
3636
DOT = 23
3737
PERCENT = 24
38-
BACKQUOTE = 25
3938
LBRACE = 26
4039
RBRACE = 27
4140
EQEQUAL = 28

Modules/parsermodule.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2404,11 +2404,6 @@ validate_atom(node *tree)
24042404
if (res && (nch == 3))
24052405
res = validate_dictmaker(CHILD(tree, 1));
24062406
break;
2407-
case BACKQUOTE:
2408-
res = ((nch == 3)
2409-
&& validate_testlist1(CHILD(tree, 1))
2410-
&& validate_ntype(CHILD(tree, 2), BACKQUOTE));
2411-
break;
24122407
case NAME:
24132408
case NUMBER:
24142409
res = (nch == 1);

0 commit comments

Comments
 (0)