Aleksey Kladov
4551182f94
use usual token tree for macro expansion
2019-09-17 15:51:48 +03:00
Aleksey Kladov
9eb14e1170
cleanup expansion to item list
2019-09-10 22:22:57 +03:00
Aleksey Kladov
1834bae5b8
allow rustfmt to reorder imports
...
This wasn't a right decision in the first place, the feature flag was
broken in the last rustfmt release, and syntax highlighting of imports
is more important anyway
2019-07-04 23:09:09 +03:00
Edwin Cheng
31909cc7d7
By pass unbind $var while mbe expanding
2019-05-03 23:23:21 +08:00
Edwin Cheng
e8e46100d6
Refactor out tests module and remove empty subtree
2019-05-03 21:38:00 +08:00
Edwin Cheng
11d6a1449d
Fixed old incorrect test
2019-05-03 00:20:27 +08:00
Edwin Cheng
91745c62f8
Compare text instead
2019-05-02 23:59:13 +08:00
Edwin Cheng
1446d620c5
Add empty bindings and some refactoring
2019-05-02 23:23:14 +08:00
Edwin Cheng
d436ab0581
Refactor parser handle mult-char punct internally
2019-04-28 23:46:03 +08:00
Edwin Cheng
c55a2dbc1d
Fix more bugs
2019-04-26 02:03:56 +08:00
Edwin Cheng
299d97b6d9
Add handling token
seperator in mbe
2019-04-26 02:03:55 +08:00
Edwin Cheng
e4e2338f97
Fix incorrect repeat sep eating
2019-04-26 02:03:55 +08:00
Edwin Cheng
bb84fce1a4
Remove unused print out
2019-04-22 20:21:14 +08:00
Edwin Cheng
1cdfc38066
Add a test for #1178 case
2019-04-22 20:14:46 +08:00
Edwin Cheng
120bfde3c2
Add tests
2019-04-22 05:04:37 +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
1afde29adb
Add back missing assert
2019-04-19 21:52:54 +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
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
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
Aleksey Kladov
7d6bd5d137
always show token text
2019-04-02 14:49:46 +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
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
d3a252b559
Replace option with result in mbe
2019-03-02 20:30:13 +01: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
Pascal Hertleif
4fd3613434
Fix some typos
2019-02-12 15:02:57 +01:00
Aleksey Kladov
0d34a256de
assign ids when converting tt
2019-02-11 21:12:06 +03:00
bors[bot]
77ccac74f9
Merge #790
...
790: make macro-rules eq r=matklad a=matklad
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
2019-02-11 16:24:39 +00:00