Commit Graph
48 Commits
Author SHA1 Message Date
Windel Bouwman c9aa103cce Change target of for loops into single expression. 2018-10-17 13:12:04 +02:00
Windel Bouwman 6105a836ad Initial variant of list comprehensions 2018-10-17 12:05:10 +02:00
Windel Bouwman adfb750129 Added ternary if operator 2018-10-17 08:45:16 +02:00
Windel Bouwman 7728ee1e63 Minor change to keyword arguments in function call 2018-10-16 23:26:37 +02:00
Windel Bouwman 3eafcbec3d Add decorator functionality 2018-10-14 20:04:19 +02:00
Windel Bouwman 797e7f341f Merge branch 'master' of https://github.com/RustPython/RustPython into with 2018-09-11 19:21:13 +02:00
Daniel Watkins c5e36e8530 Ignore clippy warnings in lalrpop generated code 2018-09-11 00:11:03 -04:00
Windel Bouwman 0f148e1214 Merge branch 'master' of https://github.com/RustPython/RustPython into with 2018-09-10 20:10:38 +02:00
Windel Bouwman 1eab9165bf Initial work on 'with' context manager logic 2018-09-10 20:10:31 +02:00
Adam Kelly a14b776a81 Add tuple packing/unpacking assignment. (tuples only) 2018-09-09 21:19:56 +01:00
Daniel Watkins b4662925b7 Naively parse keyword arguments
This doesn't enforce ordering of non-keyword and keyword arguments, and
doesn't actually use the keywords (the arguments will still be passed
through in order as positional).
2018-08-31 15:46:07 -04:00
Daniel Watkins 85d2dd2997 Add support for default argument syntax
The enforcement of the ordering of default/non-default arguments happens
in the compiling step, but should perhaps eventually be pushed back in
to the parsing phase.
2018-08-29 08:58:20 -04:00
Daniel Watkins 2cecd362fe Add support for defaults to bytecode, compiler and VM 2018-08-29 08:58:20 -04:00
Windel Bouwman 882606ba1a Move exceptions to own struct 2018-08-25 10:11:21 +02:00
Adam Kelly 046e5e9c60 Add unary not support to parser. 2018-08-24 18:23:05 +01:00
Windel Bouwman 04b786f0f3 Add try except to compiler 2018-08-22 21:42:18 +02:00
Windel Bouwman 583818378b Add BaseException class 2018-08-22 20:29:47 +02:00
Windel Bouwman c2550ad3f1 Introduce LocatedStatement after idea from review 2018-08-22 17:49:07 +02:00
Windel Bouwman 4897e10714 Add location to statement ast type 2018-08-22 16:18:47 +02:00
Windel Bouwman 3d9b2360e3 Add row and column info to lexer 2018-08-22 12:14:37 +02:00
Windel Bouwman 17a952dbf1 fix #34 2018-08-20 22:06:01 +02:00
Windel Bouwman 15e274210f Add float type 2018-08-20 21:22:14 +02:00
Adam Kelly a9c3349943 Specify bases in normal class definitions. 2018-08-19 20:55:37 +01:00
Daniel Watkins 19c9db2375 Parse trailing commas in lists/dicts 2018-08-11 23:37:01 -04:00
Daniel Watkins a7428e3808 Implement complex import handling
This expands import parsing and handling to implement a variety of
import cases:

* `import x as y`
* `import x, y`
* `from x import y`
* `from x import y, z`
* `from x import y as z, a as b`

This fixes #51.
2018-08-09 17:14:08 -04:00
Adam Kelly 402230684f Add support for parsing classes to ast. 2018-08-09 07:41:33 +01:00
Daniel Watkins d1acf5e7db Implement simple dict literals 2018-08-07 23:49:42 -04:00
Daniel Watkins 1b259d5d61 Implement 0-size dict literal 2018-08-07 23:49:42 -04:00
Windel Bouwman a40ef57ba4 Merge pull request #41 from OddBloke/function_args
Allow Tests in function arguments (rather than just Expressions)
2018-08-06 16:48:35 +02:00
Daniel Watkins 36f6fb2733 Support creation of single-element tuples
This fixes #37
2018-08-05 16:41:20 -04:00
Daniel Watkins c8a0b04b2d Allow Tests in function arguments (rather than just Expressions)
This fixes #39
2018-08-05 16:24:32 -04:00
Daniel Watkins 862442b635 Simplify the conversion of missing slice parts to None 2018-08-03 20:55:18 -04:00
Daniel Watkins 73b2d07578 Support parsing steps in slice syntax 2018-08-03 20:55:18 -04:00
Daniel Watkins 43fafa5102 Enable semi-colon separated statements
For example, `cargo run -- -c 'print("a"); print("b")'`.
2018-07-31 16:33:27 -04:00
Adam Kelly e79ec8e4cb Suppress unused variable warnings. 2018-07-29 09:06:56 +01:00
Adam Kelly 976c1f4340 Update lexer and parser to support lambdas. 2018-07-28 10:09:08 +01:00
Windel Bouwman e7cc6b1786 Add else clause to for loop 2018-07-24 22:30:45 +02:00
Windel Bouwman 8b6e0fe0b6 Add more arithmatic 2018-07-16 21:09:05 +02:00
Windel Bouwman e47e5f3d05 Add else statement 2018-07-15 16:54:29 +02:00
Windel Bouwman 8a0d8ab624 Add += and -= 2018-07-15 10:58:20 +02:00
Windel Bouwman 36bef81ceb Change eval compile to statement 2018-07-14 16:03:50 +02:00
Windel Bouwman 5783133565 Add eval and exec compile modes 2018-07-14 15:17:19 +02:00
Windel Bouwman e6493ec996 Add new_instance method 2018-07-14 12:14:16 +02:00
Windel Bouwman 5187c2e974 Simple importing scheme working 2018-07-12 20:38:53 +02:00
Windel Bouwman 65c3ff54b0 New idea for object system 2018-07-11 17:33:10 +02:00
Windel Bouwman 7d20869dc0 Fix return value from function 2018-07-08 21:03:25 +02:00
Windel Bouwman 62cb3e2474 Add slice object 2018-07-08 12:38:55 +02:00
Windel Bouwman 4be77bcbc7 Remove unused compiler namespace in parser 2018-07-07 17:36:21 +02:00