Jeong YunWon
bf3f3eca62
Flatten rustpython_parser interface
2023-02-22 20:32:31 +09:00
Jeong YunWon
a8d4de27ed
make_tokenizer -> lex to integrate terms
...
we don't distinguish scanner or tokenizer from lexer
2023-02-22 20:28:15 +09:00
Jeong YunWon
aed03c5209
Break down rustpython_parser::error module
...
because it doesn't share any common errors but specific error for each sub module
2023-02-22 20:28:01 +09:00
Charlie Marsh
62d88e0b86
Always wrap in SoftKeywordTransformer
2023-02-21 19:18:42 -05:00
Jim Fasarakis-Hilliard
6e9c759cf7
Merge pull request #4519 from charliermarsh/charlie/match
...
Add support for match statements to parser
2023-02-21 19:43:28 +02:00
Jeong YunWon
304f6bc38e
Merge pull request #4531 from charliermarsh/charlie/exception-groups
...
Implement except* syntax
2023-02-21 13:20:18 +09:00
Charlie Marsh
2a86dbd644
Implement except* syntax
2023-02-21 12:19:54 +09:00
Charlie Marsh
4c559a9a51
Allow starred expressions in subscripts
2023-02-20 17:59:35 -05:00
Charlie Marsh
f1f31324d0
Use muiltipeek
2023-02-20 15:03:39 -05:00
Charlie Marsh
8649bf6f8f
Add support for match statements to parser
2023-02-20 15:03:39 -05:00
Dimitris Fasarakis Hilliard
66cbe3fe62
Document parser crate.
2023-02-12 17:58:19 +02:00
Jeong YunWon
4ee4fcf407
Add test_generator_expression_argument
2023-02-11 05:20:39 +09:00
Jeong YunWon
1304e4ba2f
Merge pull request #4449 from harupy/fix-dict-spread-in-dict
...
Fix AST generated from a dict literal containing dict unpacking
2023-01-22 20:44:26 +09:00
harupy
f260785da4
Remove useless String::from
...
Signed-off-by: harupy <hkawamura0130@gmail.com>
2023-01-16 21:27:57 +09:00
harupy
4f32bacf9c
Rename test
2023-01-15 23:36:07 +09:00
harupy
a7f1904564
Improve test
2023-01-15 16:53:13 +09:00
harupy
52d2e25601
Fix dict spreading in dict literal
2023-01-15 13:01:59 +09:00
Ran Benita
bb2abd1cbc
Fixup parse_tokens after "Add NonLogicalNewline token"
...
I only updated `parse()` to ignore `NonLogicalNewline`, didn't notice
it's also needed in `parse_tokens()`.
2023-01-14 11:52:33 +02:00
Ran Benita
5cc208cc43
Add NonLogicalNewline token
...
This token is completely ignored by the parser, but it's useful for
other users of the lexer, such as the Ruff linter. For example, the
token is helpful for a "trailing comma" lint.
The same idea exists in Python's `tokenize` module - there is a NEWLINE
token (logical newline), and a NL token (non-logical newline).
Fixes #4385 .
2023-01-12 16:47:12 +02:00
harupy
1a28e49adc
Include comment text in token
2023-01-06 23:29:20 +09:00
Dimitris Fasarakis Hilliard
bf715ab1ca
Move tests for with into parser.
2023-01-01 21:36:07 +02:00
harupy
faec9372f9
Fix FormattedValue location
2022-12-30 21:39:29 +09:00
harupy
a5553aea43
Fix slice location
2022-12-25 09:37:07 +09:00
harupy
2d75aeb276
Fix end location of nodes containing body
2022-12-11 12:35:28 +09:00
harupy
8e0bef913c
add tests
2022-12-04 05:59:51 +09:00
Charlie Marsh
c3f246693b
Implement Tok::Comment
2022-11-07 10:33:55 -05:00
dvermd
1dfa2e5239
improve col_offset in new line and lalr
2022-10-26 21:30:51 +02:00
dvermd
ac77f7f501
Fix ast types' _fields and use 0-based column
2022-10-27 03:09:38 +09:00
Charlie Marsh
efad01d976
Remove parse_program_tokens
2022-10-17 12:04:30 -04:00
Charlie Marsh
452d28719f
Expose a method to parse AST from tokens directly
2022-10-17 09:39:48 -04:00
Charlie Marsh
8a32bab00a
Add end locations to all nodes ( #4192 )
2022-10-17 13:18:30 +09:00
Jeong YunWon
a1640e4aa1
new_syntax_error working without full compiler
...
Fix #4100
2022-08-23 05:08:24 +09:00
Jeong YunWon
9d6ab72d79
integrate ast::Location into compilre-core::Location
2022-08-22 08:42:20 +09:00
Jeong YunWon
03ccd4b9d8
Add source_path to ParseError
2022-08-22 08:42:20 +09:00
Jeong YunWon
060d153bb3
reorganize compiler crates
2022-08-22 04:42:42 +09:00