Skip to content

Commit

Permalink
Get rid of some more cases of backquotes. parsermodule.c doesn't compile
Browse files Browse the repository at this point in the history
but looks like that was a problem before this change.
  • Loading branch information
nnorwitz committed Aug 29, 2006
1 parent 3bd844e commit 2eca440
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 17 deletions.
3 changes: 0 additions & 3 deletions Doc/lib/asttable.tex
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
\lineiii{}{\member{expr}}{}
\hline

\lineiii{Backquote}{\member{expr}}{}
\hline

\lineiii{Bitand}{\member{nodes}}{}
\hline

Expand Down
2 changes: 1 addition & 1 deletion Include/token.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ extern "C" {
#define EQUAL 22
#define DOT 23
#define PERCENT 24
#define BACKQUOTE 25
/* #define BACKQUOTE 25 */
#define LBRACE 26
#define RBRACE 27
#define EQEQUAL 28
Expand Down
4 changes: 0 additions & 4 deletions Lib/compiler/transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ def __init__(self):
self._atom_dispatch = {token.LPAR: self.atom_lpar,
token.LSQB: self.atom_lsqb,
token.LBRACE: self.atom_lbrace,
token.BACKQUOTE: self.atom_backquote,
token.NUMBER: self.atom_number,
token.STRING: self.atom_string,
token.NAME: self.atom_name,
Expand Down Expand Up @@ -740,9 +739,6 @@ def atom_lbrace(self, nodelist):
return Dict((), lineno=nodelist[0][2])
return self.com_dictsetmaker(nodelist[1])

def atom_backquote(self, nodelist):
return Backquote(self.com_node(nodelist[1]))

def atom_number(self, nodelist):
### need to verify this matches compile.c
k = eval(nodelist[0][1])
Expand Down
5 changes: 2 additions & 3 deletions Lib/pydoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1564,7 +1564,7 @@ class Helper:
'CLASSES': ('ref/types', 'class SPECIALMETHODS PRIVATENAMES'),
'MODULES': ('lib/typesmodules', 'import'),
'PACKAGES': 'import',
'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'),
'EXPRESSIONS': ('ref/summary', 'lambda or and not in is BOOLEAN COMPARISON BITWISE SHIFTING BINARY FORMATTING POWER UNARY ATTRIBUTES SUBSCRIPTS SLICINGS CALLS TUPLES LISTS DICTIONARIES'),
'OPERATORS': 'EXPRESSIONS',
'PRECEDENCE': 'EXPRESSIONS',
'OBJECTS': ('ref/objects', 'TYPES'),
Expand All @@ -1587,14 +1587,13 @@ class Helper:
'IDENTIFIERS': ('ref/identifiers', 'keywords SPECIALIDENTIFIERS'),
'SPECIALIDENTIFIERS': ('ref/id-classes', ''),
'PRIVATENAMES': ('ref/atom-identifiers', ''),
'LITERALS': ('ref/atom-literals', 'STRINGS BACKQUOTES NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS'),
'LITERALS': ('ref/atom-literals', 'STRINGS NUMBERS TUPLELITERALS LISTLITERALS DICTIONARYLITERALS'),
'TUPLES': 'SEQUENCES',
'TUPLELITERALS': ('ref/exprlists', 'TUPLES LITERALS'),
'LISTS': ('lib/typesseq-mutable', 'LISTLITERALS'),
'LISTLITERALS': ('ref/lists', 'LISTS LITERALS'),
'DICTIONARIES': ('lib/typesmapping', 'DICTIONARYLITERALS'),
'DICTIONARYLITERALS': ('ref/dict', 'DICTIONARIES LITERALS'),
'BACKQUOTES': ('ref/string-conversions', 'repr str STRINGS LITERALS'),
'ATTRIBUTES': ('ref/attribute-references', 'getattr hasattr setattr ATTRIBUTEMETHODS'),
'SUBSCRIPTS': ('ref/subscriptions', 'SEQUENCEMETHODS1'),
'SLICINGS': ('ref/slicings', 'SEQUENCEMETHODS2'),
Expand Down
1 change: 0 additions & 1 deletion Lib/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
EQUAL = 22
DOT = 23
PERCENT = 24
BACKQUOTE = 25
LBRACE = 26
RBRACE = 27
EQEQUAL = 28
Expand Down
5 changes: 0 additions & 5 deletions Modules/parsermodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2404,11 +2404,6 @@ validate_atom(node *tree)
if (res && (nch == 3))
res = validate_dictmaker(CHILD(tree, 1));
break;
case BACKQUOTE:
res = ((nch == 3)
&& validate_testlist1(CHILD(tree, 1))
&& validate_ntype(CHILD(tree, 2), BACKQUOTE));
break;
case NAME:
case NUMBER:
res = (nch == 1);
Expand Down

0 comments on commit 2eca440

Please sign in to comment.