Commit Graph

67 Commits

Author SHA1 Message Date
rocky
8542df4639 Add context manager test...
handle degenerate 3.8 withas
2024-03-07 18:08:07 -05:00
rocky
600688a65d Sync with decompyle3 2022-09-17 10:54:09 -04:00
rocky
d62310f799 Correct 3.6ish dictionary literals printing 2022-05-03 12:19:43 -04:00
rocky
d48801964c Use attr insead of pattrr for non-strings 2022-04-26 03:13:27 -04:00
rocky
1a673aba40 Reinstate a test 2022-04-13 03:05:04 -04:00
rocky
04510ac2f8 lambda formatting in f-string
In a formatted string using "lambda',  we should not add "\n".
For example in:
  f'{(lambda x:x)("8")!r}'

Adding a "\n" after "lambda x: x" will give an error message:
  SyntaxError: f-string expression part cannot include a backslash
2022-04-12 16:49:58 -04:00
rocky
0f80c38530 Better doc string detection
A bug in 2.7 test_descr.py revealed a problem with the way we were
detecting docstrings.

        __doc__ = DocDescr()

was getting confused with a docstring.

This program also reveals other bugs in 3.2+ but we'll deal with that
in another commit.
2020-07-19 20:31:50 -04:00
rocky
af8add9df4 Bug in finding annotation in fn with docstring 2020-03-31 11:13:12 -04:00
rocky
874d196e5c 3.x ifelsestmtc reduction rule fix 2020-02-13 05:41:15 -05:00
rocky
16a51961c3 Add tests based on recent runtests.sh failures...
These run quicker and are distilled to simple examples.
2020-02-01 20:32:23 -05:00
rocky
10695d882e Fix bug in 3.7 chained comparison semantic action 2020-01-24 06:14:28 -05:00
rocky
5c31fdc362 Fix bug in 3.6 handling kwonly params ...
when there are annotation args
2020-01-24 05:47:41 -05:00
rocky
beac1d3567 Fix a bug in 3.6+ keyword-only argument passing 2020-01-21 04:37:58 -05:00
rocky
a532aa5b0e 3.7+ use attribute_w_parens like we do in pre 3.7 2020-01-16 11:43:29 -05:00
rocky
172239f50b More accurate 3.6 "ifsmt" and "ifelsesmt" 2020-01-16 04:11:12 -05:00
rocky
73937ffeb4 Handle set/dictionary comprehensions in format strings 2020-01-13 23:49:17 -05:00
rocky
a918055a31 3.6+ nested format strings again 2020-01-13 21:25:20 -05:00
rocky
ec3a9978fc Better 3.6+ nested format strings 2020-01-13 19:08:54 -05:00
rocky
54f4806021 More fstring bugs -- nested fstring grammar rules 2020-01-13 08:04:53 -05:00
rocky
de282af05d Fix some fstring formats bugs...
* Need parens around a lambda in an format string.
* handle format string specifier + width

Note: other format-string bugs remain.
2020-01-13 06:40:18 -05:00
rocky
f56ad56021 Wacky string at beginning of fn which is not docstring...
3.7.6 test_fstring.py tests this.
2020-01-12 22:59:06 -05:00
rocky
c3d7ba6dad 3.7 "imports" and "or" 2020-01-11 07:23:23 -05:00
rocky
7b76d55e55 Start to fold in 3.7 reduction-rule goodness into 3.6 2020-01-08 19:50:05 -05:00
rocky
6646d18c7a More complex complex test 2020-01-05 11:54:41 -05:00
rocky
faf6ea9630 imports for 3.7+ again 2019-12-29 01:28:05 -05:00
rocky
b2e1edb434 Fix Python 3.7+ "import as" but keep "import from" working 2019-12-28 11:09:31 -05:00
rocky
bffbd0b352 3.6+ lambda params; add semantic rule customizing for lambdas 2019-12-23 07:19:40 -05:00
rocky
6a82b1045e 3.x lambda * handling 2019-12-22 12:28:27 -05:00
rocky
f3bec73840 Fix Bug in 3.6+ in call_ex_kw4 and call_kw36 2019-12-22 08:49:12 -05:00
rocky
805ec7dbfc Add "if_not_and" rule similar to "if_not_or" rule. 2019-12-13 05:15:21 -05:00
x0ret
2e01f42f65 Fixes #278 2019-07-14 01:12:42 +04:30
rocky
4c76931807 Update tests related to branch 2019-06-30 18:20:40 -04:00
rocky
9ab086b207 Add more x0ret tests 2019-06-09 15:19:01 -04:00
rocky
86fd5dbf7a 3.3-3.4 pos kwargs ordering 2019-06-08 18:40:50 -04:00
rocky
9bae73679f Reinstate 3.6. docstring test 2019-06-07 12:32:21 -04:00
rocky
ceebe9ab60 Add x0ret's annotation test on 3.6 2019-06-07 04:56:03 -04:00
rocky
8b5e0f49f8 Handle {{ }} escape, but when appropriate 2019-05-13 09:41:16 -04:00
x0ret
bf56fbeeec enhance call_ex_kw(s) positional args handling 2019-05-12 13:11:31 +04:30
rocky
c03b039714 Small tweaks to last commit 2019-05-10 17:25:25 -04:00
rocky
e875b79a75 Fix 3.6. call_ex_kw semantic action
Was missing positional args parameter in template. Fix submited by @x0ret

Fixes #227
2019-05-09 09:27:10 -04:00
rocky
b05500dd49 More 3.6+ fstring bugs 2019-05-08 08:57:30 -04:00
rocky
733a44e22f Revise and hopefully improve 3.6+ fstring handling 2019-05-08 06:03:39 -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
257bbc892f Better 3.6+ format specification handling 2019-05-01 09:17:35 -04:00
rocky
f54cf20d9d Hacky handling of 3.6 format string 'X'. 2019-04-30 20:06:36 -04:00
rocky
3730946a1a Add semantic rule for 3.x "conditionalnot" 2019-04-22 21:18:17 -04:00
rocky
f1b69a8a28 Add rule for 3.x comp_for 2019-04-22 18:42:21 -04:00
rocky
0de99e5d44 Scale back "try" vs. "tryelse" reduction test on 3.6+ 2019-04-18 16:45:44 -04:00
rocky
52af2ba32a 3.6+ lambda parameter handling 2019-04-18 14:21:52 -04:00