Skip to content

Commit

Permalink
i made some changes apparently
Browse files Browse the repository at this point in the history
  • Loading branch information
thatbirdguythatuknownot committed Sep 22, 2023
1 parent a656827 commit b9b6db9
Show file tree
Hide file tree
Showing 13 changed files with 2,789 additions and 2,459 deletions.
4 changes: 4 additions & 0 deletions Doc/library/token-list.inc

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Grammar/Tokens
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ COLONEQUAL ':='
EXCLAMATION '!'
PIPEGT '|>'
DOLLAR '$'
PIPEGTEQUAL '|>='

OP
TYPE_IGNORE
Expand Down
3 changes: 3 additions & 0 deletions Grammar/python.gram
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ assignment[stmt_ty]:
CHECK_VERSION(stmt_ty, 6, "Variable annotations syntax is", _PyAST_AnnAssign(a, b, c, 0, EXTRA)) }
| a[asdl_expr_seq*]=(z=star_targets '=' { z })+ b=(yield_expr | star_expressions) !'=' tc=[TYPE_COMMENT] {
_PyAST_Assign(a, b, NEW_TYPE_COMMENT(p, tc), EXTRA) }
| a=single_target t=(t='|>=' { (++p->subn, t) }) ~ c=(d=[yield_expr | star_expressions] { (--p->subn, d) }) {
_PyAST_AugAssign(a, Comp, c, EXTRA) }
| a=single_target b=augassign ~ c=(yield_expr | star_expressions) {
_PyAST_AugAssign(a, b->kind, c, EXTRA) }
| invalid_assignment
Expand All @@ -175,6 +177,7 @@ augassign[AugOperator*]:
| '>>=' { _PyPegen_augoperator(p, RShift) }
| '**=' { _PyPegen_augoperator(p, Pow) }
| '//=' { _PyPegen_augoperator(p, FloorDiv) }
| '|>=' { _PyPegen_augoperator(p, Comp) }

return_stmt[stmt_ty]:
| 'return' a=[star_expressions] { _PyAST_Return(a, EXTRA) }
Expand Down
2 changes: 1 addition & 1 deletion Include/internal/pycore_ast.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Include/internal/pycore_ast_state.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 12 additions & 11 deletions Include/internal/pycore_token.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,18 @@ extern "C" {
#define EXCLAMATION 54
#define PIPEGT 55
#define DOLLAR 56
#define OP 57
#define TYPE_IGNORE 58
#define TYPE_COMMENT 59
#define SOFT_KEYWORD 60
#define FSTRING_START 61
#define FSTRING_MIDDLE 62
#define FSTRING_END 63
#define COMMENT 64
#define NL 65
#define ERRORTOKEN 66
#define N_TOKENS 68
#define PIPEGTEQUAL 57
#define OP 58
#define TYPE_IGNORE 59
#define TYPE_COMMENT 60
#define SOFT_KEYWORD 61
#define FSTRING_START 62
#define FSTRING_MIDDLE 63
#define FSTRING_END 64
#define COMMENT 65
#define NL 66
#define ERRORTOKEN 67
#define N_TOKENS 69
#define NT_OFFSET 256

/* Special definitions for cooperation with parser */
Expand Down
26 changes: 14 additions & 12 deletions Lib/token.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Parser/Python.asdl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ module Python
boolop = And | Or

operator = Add | Sub | Mult | MatMult | Div | Mod | Pow | LShift
| RShift | BitOr | BitXor | BitAnd | FloorDiv
| RShift | BitOr | BitXor | BitAnd | FloorDiv | Comp
| CompCall

unaryop = Invert | Not | UAdd | USub

Expand Down
Loading

0 comments on commit b9b6db9

Please sign in to comment.