Commit Graph

80 Commits

Author SHA1 Message Date
Windel Bouwman
b2d0729ca8 Fix lexing of 1else. 2019-08-02 19:08:59 +02:00
Windel Bouwman
1fddce461f Implement review comments and improve parsing a bit. 2019-07-25 23:54:31 +02:00
Windel Bouwman
a06bd3ecea Add an example usecase of the parser. 2019-07-24 20:13:30 +02:00
Windel Bouwman
255b744217 Minor tweak on lexer to fix the REPL. 2019-07-21 22:11:37 +02:00
Windel Bouwman
e922a6a952 Fix trailing newline issue #17 2019-07-21 14:00:55 +02:00
Windel Bouwman
8c199ee2f2 Refactor the lexer code to bring some more sanity and reduce function size. 2019-07-21 13:05:10 +02:00
Aviv Palivoda
e4322f52a9 Merge pull request #1112 from RustPython/parser-error-cleaning
parser error handling improvements.
2019-07-07 20:16:16 +03:00
Maxim Kurnikov
347d48198e fix remaining clippy warnings 2019-07-07 06:27:07 +03:00
Windel Bouwman
97f982530a parser error handling improvements. 2019-07-06 20:18:18 +02:00
Aviv Palivoda
0e74d16498 Pass ParseError location to CompileError 2019-07-06 10:23:32 +03:00
Aviv Palivoda
ef1d5433df Pass more information in user defined parse error 2019-07-05 11:01:49 +03:00
Windel Bouwman
f816a50110 Change get_row() into row() 2019-06-30 20:23:01 +02:00
Antonio Yang
974dc683e4 support unicode literal
- support unicode literal \x with 2 digits
- support unicode literal \u with 4 digits
- support unicode literal \U with 8 digits
- avoid to parse \x as unicode literal in bytes
2019-06-20 00:30:38 +08:00
Windel Bouwman
aa6b155e1e Merge branch 'master' of https://github.com/RustPython/RustPython into walrus 2019-06-09 11:49:02 +02:00
Windel Bouwman
9d9fcfc034 Removal of walrus operator. 2019-06-08 16:38:15 +02:00
Windel Bouwman
9592e94920 Isolate determination of indentation into seperate method. 2019-06-08 16:23:51 +02:00
Daniel Shaulov
bd89c4e32b Reformat with rustfmt 2019-05-27 22:19:07 +03:00
Daniel Shaulov
b2f17a18ea Add support for marshal with loads and dumps 2019-05-27 22:09:47 +03:00
Windel Bouwman
b8c788197e Add walrus operator to lexer and try to make lexer code cleaner. 2019-05-12 22:35:28 +02:00
Windel Bouwman
e1bdae000c Merge pull request #904 from RustPython/async-stuff
Add async def and async for parsing.
2019-05-05 21:16:29 +02:00
Windel Bouwman
5bc1aa08dc Add async def and async for parsing. 2019-05-02 16:55:33 +02:00
Windel Bouwman
1247a35be9 Improve handling of lexical errors. 2019-05-01 21:05:21 +02:00
jgirardet
eb2d0b01ee refactor lex byte 2019-04-18 08:06:06 +02:00
Jimmy Girardet
9c57ae4046 support bytes creation from hex and ascii 2019-04-17 15:28:14 +02:00
ben
1f8181b561 Update formatting to be consistent with rustfmt included in 1.34 2019-04-14 09:40:59 +12:00
Windel Bouwman
58a393f047 Merge pull request #804 from jgirardet/refactore_bytes
refactor bytes
2019-04-11 08:20:01 +02:00
Jimmy Girardet
54c7335f1c SyntaxError for non ascii char 2019-04-10 18:05:28 +02:00
Windel Bouwman
ab3d004c42 Fix syntax for float literals, statements seperated by semicolons and starargs after keyword arguments. 2019-04-05 21:59:20 +02:00
Windel Bouwman
73cd680d8d Add support for trailing comma in function defs. Parser code simplications. 2019-03-28 17:50:41 +01:00
Windel Bouwman
ca11e7dea7 Add support for emoji as name. 2019-03-24 20:16:38 +01:00
Windel Bouwman
d0c4fcb2fa Doing what is needed for all our non-latin friends. 2019-03-24 13:14:38 +01:00
Ryan Liddle
b7c03b4be5 Merge pull request #601 from RustPython/ellipsis
Add ellipsis syntax.
2019-03-05 18:30:44 +11:00
Windel Bouwman
05929b3d7b Add ellipsis type, test and do rustfmt. 2019-03-05 07:19:00 +01:00
Windel Bouwman
a26401707f Minor lexer simplifications. 2019-03-04 21:25:35 +01:00
Windel Bouwman
e25742f184 Add ellipsis syntax. 2019-03-04 21:09:03 +01:00
Aaron
267934bb49 fmt 2019-02-26 12:50:18 -08:00
Aaron
b1088c629c fmt 2019-02-26 00:55:16 -08:00
Aaron
b0bf93e530 add lexer error 2019-02-25 21:13:18 -08:00
Windel Bouwman
e058179b04 Merge pull request #458 from ZapAnton/2018_edition
Migrated the project to the Rust 2018 edition
2019-02-20 16:44:31 +01:00
ZapAnton
f1654cb890 Migrated the project to the Rust 2018 edition 2019-02-14 12:02:32 +03:00
Joey Hain
bc4e48ae61 Fix tests 2019-02-13 23:32:55 -08:00
Joey Hain
400ad80b64 fstrings 2019-02-13 21:59:21 -08:00
Tommaso Thea Cioni
8ffd4c5e56 Fixed #402. (#414)
Raise syntax error rather than panicking on expected closing bracket. 

* Fixed #402.
2019-02-09 18:10:40 +00:00
klemens
79a7e5e42b spelling fixes 2019-02-09 12:00:46 +01:00
Windel Bouwman
2b22cd443e Implement clippy thoughts into rustpython_parser 2019-02-04 18:18:40 +01:00
Gitea
9468b657d2 Run cargo fmt. 2018-12-16 17:40:25 -05:00
Gitea
c74cd90d8e Handle mixed spaces and tabs.
This allows the parser to handle tabs and spaces. Currently it
requires that spaces come after any tabs, which is slightly more
strict than python3. It also requires that neighboring indentation
levels have either both more spaces and tabs or less spaces and
tabs so that tab size can't make perception of indentation
differ from what the parser interprets.

I didn't opt to implement PartialOrd on IndentationLevel because I
wasn't sure that the comparison logic would meet the logical
requirements for that trait. One could easily switch to having it
implement PartialOrd though. This would necessitate switching to
manually implementing PartialEq so that it's behavior 'matches'.
It's unclear from the docs what 'matches' exactly means so for
now I'm avoiding implementing the traits.
2018-12-16 17:11:37 -05:00
Windel Bouwman
99af466a88 Move max function test cases to snippet dir. Implement key and default argument on max function. 2018-11-07 17:26:18 +01:00
Windel Bouwman
17fc5a2345 Implemented hexadecimal, octal and binary literals. Also use bigint in the lexer to store big integer literals. 2018-11-04 09:00:44 +01:00
Windel Bouwman
079905277b Add time module and improve lexer handling of numeric constants 2018-11-03 15:12:12 +01:00