Commit Graph

127 Commits

Author SHA1 Message Date
rocky
1cc08d9598 Make precedence table top-bottom order reference...
in https://docs.python.org/2/reference/expressions.html#operator-precedence or
https://docs.python.org/3/reference/expressions.html#operator-precedence
.
2019-05-13 09:41:16 -04:00
x0ret
d99e78d46d set precedences value for format strings 2019-05-13 09:41:09 -04:00
rocky
6d8d9fd83b Go over precedence in calls 2019-05-11 23:32:24 -04:00
rocky
f2f17740ee 2.7 if_expr_true restriction ...
condition_true -> if_expr_true
condition_lambda -> if_expr_lambda

These correspond to the Python AST names better.
2019-05-05 16:09:10 -04:00
rocky
393e5c9303 IfExp precidence handling in 2.6...
2.7 still has a bug
2019-05-05 09:48:20 -04:00
rocky
6df65a87bc Fix precidence between list_if and if_expr in 3.x 2019-05-05 08:16:29 -04:00
rocky
bc49469704 delete_subscr -> delete_subscript ...
to better (but not exactly) match the Python AST
2019-05-04 19:43:00 -04:00
rocky
7ecfb74e9a testtrue expr check nuked because of 3.7 2019-05-02 14:01:51 -04:00
rocky
2813e2212f tidy "not" precedence. 2019-05-02 11:44:20 -04:00
rocky
293e7b0367 store_subscript precedence fix and...
Allow format specifier "%p" to indicate a nonterminal name,
like "%c" allows.

store_subscr -> store_subscript to match Python AST a little closer.
2019-05-02 06:43:53 -04:00
rocky
5c58a4816f Fix 2.x delete statements expression confusion 2019-04-23 15:48:14 -04:00
rocky
f1b69a8a28 Add rule for 3.x comp_for 2019-04-22 18:42:21 -04:00
rocky
726045a05e Basic 3.8+ "for" loop handling...
More Makefile mangling
2019-04-10 11:26:58 -04:00
rocky
820283827f 3.8 "for" block ...
pysource: Tag older semantics for blocks with "expr" and "for_block"
2019-04-10 06:00:16 -04:00
rocky
19ec52eb63 Change AST to SyntaxTree in many places 2018-07-15 12:37:50 -04:00
rocky
269f4f2e1b 2.6, 2.7 Parse if else inside list comprehension
Fixes #171
2018-04-28 20:44:09 -04:00
rocky
c0022ed5b7 Typo 2018-04-25 13:05:56 -04:00
rocky
41a50b5e46 Handle if not else in lambdas...
Fixes #170
2018-04-25 12:57:09 -04:00
rocky
1b2b45642b 3.6 try except-as bug 2018-03-22 23:54:12 -04:00
rocky
28bfb453f5 Localize call_kw precedence to 3.6 2018-03-22 14:21:36 -04:00
rocky
7fc7e083c3 A couple of 3.6 bugs...
remove parens around decorators by adjusting precidence
Partial handling of quotes within 3.6 format strings
2018-03-21 19:54:28 -04:00
rocky
9f66694056 dictcomp_func -> dict_comp_func...
to match AST better. Also adds a correction in last commit,
including set_comp -> set_comp_expr where apprpriate

Note: can't use dict_comp as that was already used.
But dict_comp_func is matches AST better than dictcomp_func
2018-03-05 11:12:15 -05:00
rocky
02b1554da3 grammar and semantics for dict comp with "if"
Fixes #162
2018-03-05 07:52:02 -05:00
rocky
e9d1b86a5b Revise comprehension walking in 3.x...
less rigidly and with less magic and more verbiage as to what's going on
2018-02-27 11:13:55 -05:00
rocky
a2b6ebc669 grammar tree -> parse tree 2018-02-22 14:34:42 -05:00
rocky
09efb24a3e Start distinguishing AST from grammar tree 2018-02-22 11:17:09 -05:00
rocky
be03b22d32 Clean up fragments code for "for"...
And make a little more precise.
tag "store" part of "for" in consts.
2018-02-03 11:12:12 -05:00
rocky
a4db92ce72 funcdefdeco -> function_def_deco ...
to match AST grammar more analogously
2018-01-11 01:44:34 -05:00
rocky
acdefb4f70 NT return_stmt -> return to match AST 2017-12-14 11:03:15 -05:00
rocky
4cd4ad22b6 NT passtmt -> pass to match AST 2017-12-14 05:31:17 -05:00
rocky
b544827192 NT: "forstmt" renamed to "for" to match AST 2017-12-12 12:33:27 -05:00
rocky
ef08677287 Reinstate kwargs1...
was just missing the semantic action rule for it
2017-12-07 13:24:55 -05:00
rocky
7daf95fcb4 NT break_stmt, continue_stmt -> break, continue...
to match AST
2017-12-06 01:48:44 -05:00
rocky
f8d6998b22 NT continue_stmt -> continue to match AST 2017-12-06 01:45:08 -05:00
rocky
c953701623 Slightly better 3.x list comprehension handling 2017-12-04 14:15:06 -05:00
rocky
c791a45aae Handle a wierd 2.6 conditional false expression...
from 2.6. test_grammar
2017-12-03 19:56:14 -05:00
rocky
344d2d92c4 NT: load_attr -> attribute to match AST 2017-12-03 13:02:22 -05:00
rocky
f78a3fb92e Parens around constant in method call ..
again.
Note what fails in 2.7 runtests
2017-12-03 12:25:26 -05:00
rocky
5fe8303184 Two bugs and a refactor ..
1. parse2.py: try except in a loop with a (virtual) continue
   treat CONTINUE like JUMP_ABSOLUTE which it is
2. in taking methods off of constants, a parenthesis needs to be added

Some refactoring of global code done
2017-12-03 10:46:22 -05:00
rocky
eafb32b9a0 NT trystmt -> try_except to match AST 2017-12-02 22:20:45 -05:00
rocky
5919be1451 Fix chained compares with -'s 2017-12-02 12:06:01 -05:00
rocky
03a5ad3d94 NT funcdef -> function_def to match AST 2017-12-01 21:36:23 -05:00
rocky
dd0fe36af0 NT importfrom -> import_from ...
to match AST better
and importstar -> import_from_star

misc administrivia
2017-12-01 04:33:04 -05:00
rocky
dfdd5c6c1c NT build_list -> list to match AST 2017-12-01 03:55:31 -05:00
rocky
01b5ed2304 NT mapexpr -> dict to match AST 2017-11-30 15:59:15 -05:00
rocky
ac4d4d1da9 NT dictcomp -> dict_comp to match AST 2017-11-30 08:50:00 -05:00
rocky
0b284f8230 NT setcomp -> set_comp to match AST 2017-11-30 07:14:29 -05:00
rocky
fcdea73b4f list_compr -> list_comp to match AST...
more Python 3 custom rule cleanup
2017-11-29 21:26:31 -05:00
rocky
34117522b2 NT importstmt -> import to match AST 2017-11-29 20:20:54 -05:00
rocky
11e2637eeb NT augassign -> aug_assign to match AST 2017-11-29 10:51:38 -05:00