Kaydet (Commit) 6e4f2c09 authored tarafından Fred Drake's avatar Fred Drake

Use the "st" versions of the "ast" calls in the parser module -- there is

no reason to pretend the syntax trees we're dealing with are abstract.
üst c2683ddb
...@@ -13,7 +13,7 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase): ...@@ -13,7 +13,7 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
st1 = f(s) st1 = f(s)
t = st1.totuple() t = st1.totuple()
try: try:
st2 = parser.sequence2ast(t) st2 = parser.sequence2st(t)
except parser.ParserError: except parser.ParserError:
self.fail("could not roundtrip %r" % s) self.fail("could not roundtrip %r" % s)
...@@ -140,7 +140,7 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase): ...@@ -140,7 +140,7 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
class IllegalSyntaxTestCase(unittest.TestCase): class IllegalSyntaxTestCase(unittest.TestCase):
def check_bad_tree(self, tree, label): def check_bad_tree(self, tree, label):
try: try:
parser.sequence2ast(tree) parser.sequence2st(tree)
except parser.ParserError: except parser.ParserError:
pass pass
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment