Edwin Cheng
49c9686c3c
Handle *+
case and single token case
2019-04-22 05:04:37 +08:00
Edwin Cheng
bcf5cf8ac6
fix mbe_parser rhs colon parsing
2019-04-22 05:04:37 +08:00
Edwin Cheng
da05bbcfb1
Fix lifetime in tt to syntax node conversion
2019-04-22 05:04:36 +08:00
Edwin Cheng
9e35bf91b8
Fix bugs
2019-04-20 23:53:39 +08:00
Edwin Cheng
210c762fe6
Disable test_tt_xx
2019-04-20 02:41:13 +08:00
Edwin Cheng
41c1a639c3
Disable tt matcher
2019-04-20 02:19:46 +08:00
Edwin Cheng
1afde29adb
Add back missing assert
2019-04-19 21:52:54 +08:00
Edwin Cheng
763569017a
Fix bug for ident to lifetime
2019-04-19 21:43:41 +08:00
Edwin Cheng
87ff908135
Add vis matcher
2019-04-19 21:38:26 +08:00
Edwin Cheng
c5983b85fc
Add literal matcher
2019-04-19 21:21:47 +08:00
Edwin Cheng
313854c728
Add lifetime matcher
2019-04-19 21:15:19 +08:00
Edwin Cheng
59b6cc780b
add tt matcher
2019-04-19 19:41:59 +08:00
Edwin Cheng
762819864f
add block matcher
2019-04-19 19:33:29 +08:00
Edwin Cheng
8092b6487f
Add block matcher
2019-04-19 18:30:43 +08:00
bors[bot]
ab0a96586f
Merge #1148
...
1148: Add token_tree_to_xxx functions r=matklad a=edwin0cheng
<del>As discus in PR #1147 , this PR added a `mbe::MacroKind` .
Currently only 2 kind of macro are supported, `SourceFile` and `Block`.</del>
Added following functions for `tt::TokenTree` and `ast::Node` conversion:
* token_tree_to_expr
* token_tree_to_pat
* token_tree_to_ty
* token_tree_to_macro_stmts
* token_tree_to_macro_items
And added two new syntax kind:
* MACRO_ITEMS
* MACRO_STMTS
Co-authored-by: Edwin Cheng <edwin0cheng@gmail.com>
2019-04-19 08:56:39 +00:00
Edwin Cheng
a6d51e0961
Return Result for token_tree_to_xx functions
2019-04-19 04:03:22 +08:00
Edwin Cheng
c0f19d7005
Add expr, pat, ty and macro_stmts
2019-04-19 03:49:56 +08:00
Edwin Cheng
3ff5440a50
Add MacroItems and MacroStmts in grammer.ron
2019-04-19 02:47:29 +08:00
Edwin Cheng
e8ddeb869d
Fix missing last token in mbe $repeat parsing
2019-04-18 23:33:54 +08:00
Edwin Cheng
e944fd059d
Add item
matcher in mbe
2019-04-18 10:21:36 +08:00
Edwin Cheng
57e4122b89
Add mbe stmt matcher
2019-04-17 12:34:43 +08:00
Edwin Cheng
6646d49f23
Fix bug and add expr , pat , ty matcher
2019-04-14 11:42:20 +08:00
Edwin Cheng
f66300ccd1
Remove skip Delimiter::None and handle Dollars
2019-04-13 01:50:05 +08:00
Edwin Cheng
8ed7104578
Refactoring and add some docs
2019-04-08 20:32:21 +08:00
Edwin Cheng
c785c7312d
Fixed infintite loop bug
2019-04-08 19:21:07 +08:00
Edwin Cheng
184e9ea230
Fixed empty node bug
2019-04-08 18:21:48 +08:00
Edwin Cheng
2697ecaa64
Use SubtreeWalker instread of flatten TtToken
2019-04-08 15:58:02 +08:00
Edwin Cheng
a7254201df
Combine all tokensource to one and refactoring
2019-04-08 00:12:07 +08:00
Edwin Cheng
7f1e93a3c9
Refactoring subtree_source
2019-04-07 21:42:53 +08:00
Edwin Cheng
aac9dfa464
Add TtCursorTokenSource and TtCursorTokenSink
2019-04-06 20:14:28 +08:00
Edwin Cheng
1d7735fbc6
Add path test and empty eat_path handling
2019-04-06 12:12:32 +08:00
Edwin Cheng
7abc06bd57
Add proper test for literals and fixed typo bug
2019-04-05 20:58:24 +08:00
Edwin Cheng
1ea0238e53
Add classify_literal and undo expose next_token
2019-04-05 18:45:19 +08:00
Edwin Cheng
1ab78d6056
Fix literal support in token tree to ast item list
2019-04-05 18:23:01 +08:00
Edwin Cheng
6ff16c7ad9
Clean up
2019-04-05 03:54:18 +08:00
Edwin Cheng
c23408751c
Add multi-byte token support in tkn tree to ast
2019-04-05 03:39:54 +08:00
Aleksey Kladov
7d6bd5d137
always show token text
2019-04-02 14:49:46 +03:00
Aleksey Kladov
9e213385c9
switch to new rowan
2019-04-01 12:06:24 +03:00
Aleksey Kladov
d4449945a0
hack around non-terminating macro expansion
2019-03-17 12:52:52 +03:00
Aleksey Kladov
182c05a96c
add name resolution from the old impl
...
unlike the old impl, this also handles macro imports across crates
2019-03-17 12:46:13 +03:00
Wilco Kusee
c9d6efc468
Add expander unit tests
2019-03-03 20:33:50 +01:00
Wilco Kusee
d149bb885b
Add parser unit tests
2019-03-03 12:45:30 +01:00
Wilco Kusee
725805dc79
Split parse and expand errors
2019-03-03 10:40:03 +01:00
Wilco Kusee
dffe318701
Formatting
2019-03-02 20:49:13 +01:00
Wilco Kusee
d3a252b559
Replace option with result in mbe
2019-03-02 20:30:13 +01:00
Dale Wijnand
ffca2c1fe4
Fix a typo
2019-02-26 17:59:32 +00:00
Aleksey Kladov
81bca78349
rename
2019-02-24 13:14:14 +03:00
Aleksey Kladov
8cf156d85b
Add a test for macro parsing
2019-02-23 17:51:23 +03:00
Aleksey Kladov
8eac450f41
implement tt -> ast
2019-02-23 17:21:56 +03:00
Aleksey Kladov
83d6be6cec
keep-text
2019-02-23 16:55:18 +03:00