Jeong YunWon
f07b97cef3
Fix match parsing
2025-01-22 01:45:40 +09:00
Jeong YunWon
e00297d1c7
apply clippy suggestions
2025-01-22 01:40:09 +09:00
hydrogen602
51b5f80ae3
fix for Lib/test/test_future_stmt/test_future.py: test_annotations
2024-05-12 16:12:44 +09:00
Daniel Chiquito
649fdd4be9
Fix type param order during source location
...
There is a `debug_assert!` during source location which verifies that
there is no backtracking during the location scanning process. Type
params were being folded after everything else, which required a
backtrack. This caused any code with function or class type parameters
to break when run in debug mode.
2024-05-12 16:09:30 +09:00
Jeong, YunWon
6a2aa264b1
Merge pull request #107 from m-spitfire/fix-unparse
...
fix(ast): make unparse module public
2024-05-10 14:10:32 +09:00
yt2b
9ce55aefde
Incorrect f-string parsing ( #112 )
...
* Fix parse_fstring
* Add test
* Push char
* Remove unused import
2024-01-23 17:20:32 +09:00
Jeong, YunWon
29c4728dbe
remove size assertions to avoid nightly error ( #111 )
2023-12-28 01:36:46 +09:00
Murad Bashirov
6ff2284953
fix(ast): make unparse module public
2023-10-22 15:11:52 +09:00
Zanie
3617a6c52b
Bump size assertion for Stmt
from 136 to 160 bytes
2023-07-10 16:48:05 -05:00
Zanie
7b0aeeec4b
Add stub type_params
handling for class and function definitions
2023-07-10 14:00:34 -05:00
Zanie
df2b5dfed0
Regenerate code with latest ASDL
2023-07-10 13:45:36 -05:00
Jeong, YunWon
69d27d924c
Rename unconventional nodes ( #74 )
2023-06-17 01:54:00 +09:00
Steve Shi
a2e3209c42
Replace num-bigint with malachite-bigint ( #18 )
...
Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2023-06-02 17:06:18 +09:00
Jeong, YunWon
5e9e8a7589
Linear Locator ( #46 )
2023-06-01 13:53:31 +09:00
Jeong, YunWon
fdec727f80
New Arguments and Arg/ArgWithDefault AST representation ( #59 )
2023-06-01 01:15:23 +09:00
Jeong, YunWon
531aeb3511
Cmpop::as_str ( #72 )
...
* clean up pyo3 generation
* Cmpop::as_str
2023-05-29 01:53:54 +09:00
Jeong YunWon
7d384d88d0
Separate rustpython_ast_pyo3
2023-05-23 02:50:12 +09:00
Jeong YunWon
b81273e9bc
to_pyo3_ast to return &'py
2023-05-23 00:12:22 +09:00
Jeong, YunWon
e1f02fced7
Fix Vec::to_pyo3_ast ( #63 )
2023-05-22 15:15:05 +09:00
Jeong, YunWon
d4084fb17a
impl From<T> for ast::Ast ( #62 )
2023-05-21 22:44:07 +09:00
Jeong, YunWon
3654cf0bdf
Add Ast
as top level enum ( #58 )
2023-05-19 01:53:39 +09:00
Jeong, YunWon
6c5c311bab
Fix range field order ( #56 )
...
* Skip validate_arguments when empty
* Fix `range` field order
* Fix unused variable
2023-05-18 21:44:01 +09:00
Jeong, YunWon
b48834fe2d
More flexible map_user and fold for new constructor nodes ( #53 )
...
* make fold.rs file
* Split user_map steps
* Fold for new constructor nodes
2023-05-18 00:16:04 +09:00
Jeong, YunWon
e820928f11
Add experimental pyo3-wrapper feature ( #41 )
...
* Fix pyo3 unit type value error
* Add experimental pyo3-wrapper feature
* location support
2023-05-16 23:45:31 +09:00
Jeong, YunWon
9d47d3d212
specialize ConversionFlag ( #42 )
...
* specialize ConversionFlag
* Change value of ConversionFlag to i8 and None to -1
* is_* methods to ConversionFlag
2023-05-16 22:52:50 +09:00
Jeong, YunWon
611dcc2e9b
rustpython_ast + pyo3 ( #25 )
2023-05-16 18:06:54 +09:00
Jeong, YunWon
53de75efc3
Add all node classes to ast module ( #40 )
2023-05-16 16:55:26 +09:00
Jeong, YunWon
02f13abf50
Add Node trait for node type information ( #31 )
2023-05-16 15:41:30 +09:00
Jeong, YunWon
b78001c953
Generic types to generic ( #30 )
2023-05-15 20:22:42 +09:00
Jeong, YunWon
718354673e
Move range to node ( #23 )
...
* black + clippy
* Fix module generation
2023-05-15 16:20:22 +09:00
Micha Reiser
192379cede
Move range
from Attributed
to Node
s ( #22 )
...
* Move `range` from `Attributed` to `Node`s
* No Attributed + custom for Range PoC
* Generate all located variants, generate enum implementations
* Implement `Copy` on simple enums
* Move `Suite` to `ranged` and `located`
* Update tests
---------
Co-authored-by: Jeong YunWon <jeong@youknowone.org>
2023-05-15 15:08:12 +09:00
Jeong, YunWon
947fb53d0b
Field accessor and utilities ( #20 )
...
* Apply is-macro to Constant and ast nodes
2023-05-11 19:44:20 +09:00
Jeong YunWon
2af9805662
A few more Identifier utilities
2023-05-11 16:05:11 +09:00
Jeong YunWon
cbe4e8c5f3
Make parser location optional
2023-05-11 04:40:10 +09:00
Jeong YunWon
aabc96dde9
ruff integration support
2023-05-11 04:08:57 +09:00
Jeong YunWon
d6b6df5d1c
ast::Int::to_usize
2023-05-10 21:31:02 +09:00
Jeong YunWon
6fa3d0f90a
Fine-tune int types
2023-05-10 19:33:39 +09:00
Jeong YunWon
455bcc01a0
Give identifier and int ast types
2023-05-10 19:33:39 +09:00
Jeong YunWon
75f6ce1ae5
Setup spell checker
2023-05-10 17:57:15 +09:00
Jeong YunWon
17c8abcec1
asdl_rs.py to multiple file output
2023-05-10 17:41:01 +09:00
Jeong YunWon
1d366d52ab
Let located
only for python located stuff
2023-05-10 14:35:38 +09:00
Jeong YunWon
a3d9d8cb14
numerous refactoring
...
- Split parser core and compiler core. Fix #14
- AST int type to `u32`
- Updated asdl_rs.py and update_asdl.sh fix #6
- Use `ruff_python_ast::SourceLocation` for Python source location. Deleted our own Location.
- Renamed ast::Located to ast::Attributed to distinguish terms for TextSize and SourceLocation
- `ast::<Node>`s for TextSize located ast. `ast::located::<Node>` for Python source located ast.
- And also strictly renaming `located` to refer only python location related interfaces.
- `SourceLocator` to convert locations.
- New `source-code` features of to disable python locations when unnecessary.
- Also including fully merging https://github.com/astral-sh/RustPython/pull/4 closes #9
2023-05-10 14:35:38 +09:00
Jeong YunWon
09a6afdd04
Adapt SourceLocation
2023-05-09 20:34:48 +09:00
Jeong YunWon
a14e43e03a
Separate byteoffset ast and located ast
2023-05-09 00:21:52 +09:00
Jeong YunWon
f47dfca4e3
Rename compiler Location to TextSize
2023-05-08 03:38:10 +09:00
Micha Reiser
58c35ab458
Replace row/column based Location with byte-offsets.
2023-05-08 03:38:10 +09:00
Jeong YunWon
6d7358090b
Refactor ast to hold data as seperated type
2023-05-07 19:20:47 +09:00
Jeong YunWon
80109b1fe0
rustpython-literal
2023-05-05 21:49:12 +09:00
Jeong YunWon
bd64603950
Refactor common::bytes::repr using common::escape
2023-05-03 16:08:48 +09:00
Jeong YunWon
5b0e92d725
Refactor common::str::repr using common::escape
2023-05-03 13:47:04 +09:00