Skip to content

Commit

Permalink
pythongh-125811: Remove DeprecationWarnings in test_peg_generator (py…
Browse files Browse the repository at this point in the history
…thonGH-125812)

(cherry picked from commit 4efe64a)

Co-authored-by: Mikhail Efimov <[email protected]>
  • Loading branch information
efimov-mikhail authored and miss-islington committed Oct 22, 2024
1 parent 0e350d4 commit 6b93b73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Lib/test/test_peg_generator/test_pegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ def test_left_recursive(self) -> None:

def test_python_expr(self) -> None:
grammar = """
start: expr NEWLINE? $ { ast.Expression(expr, lineno=1, col_offset=0) }
start: expr NEWLINE? $ { ast.Expression(expr) }
expr: ( expr '+' term { ast.BinOp(expr, ast.Add(), term, lineno=expr.lineno, col_offset=expr.col_offset, end_lineno=term.end_lineno, end_col_offset=term.end_col_offset) }
| expr '-' term { ast.BinOp(expr, ast.Sub(), term, lineno=expr.lineno, col_offset=expr.col_offset, end_lineno=term.end_lineno, end_col_offset=term.end_col_offset) }
| term { term }
Expand Down Expand Up @@ -893,7 +893,7 @@ def test_unreachable_implicit3(self) -> None:

def test_locations_in_alt_action_and_group(self) -> None:
grammar = """
start: t=term NEWLINE? $ { ast.Expression(t, LOCATIONS) }
start: t=term NEWLINE? $ { ast.Expression(t) }
term:
| l=term '*' r=factor { ast.BinOp(l, ast.Mult(), r, LOCATIONS) }
| l=term '/' r=factor { ast.BinOp(l, ast.Div(), r, LOCATIONS) }
Expand Down

0 comments on commit 6b93b73

Please sign in to comment.