File tree Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Expand file tree Collapse file tree 4 files changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,10 @@ This project adheres to [Semantic Versioning](https://semver.org).
8
8
Note: In this file, do not use the hard wrap in the middle of a sentence for compatibility with GitHub comment style markdown rendering.
9
9
-->
10
10
11
+ ## [ 0.9.2] - 2025-07-01
12
+
13
+ - Syntax: add ` Or ` struct,
14
+
11
15
## [ 0.9.1] - 2025-06-23
12
16
13
17
- Broken changes: redesign ` Span ` ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ edition = "2024"
5
5
license = " MIT"
6
6
name = " parserc"
7
7
repository = " https://github.com/styles-lab/parserc"
8
- version = " 0.9.1 "
8
+ version = " 0.9.2 "
9
9
10
10
[dependencies ]
11
11
memchr = " ^2.7"
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ edition = "2024"
5
5
license = " MIT"
6
6
name = " parserc-derive"
7
7
repository = " https://github.com/styles-lab/parserc"
8
- version = " 0.9.1 "
8
+ version = " 0.9.2 "
9
9
10
10
[dependencies ]
11
11
proc-macro2 = " ^1"
Original file line number Diff line number Diff line change @@ -10,13 +10,15 @@ use syn::{
10
10
pub fn derive_syntax_trait ( input : proc_macro:: TokenStream ) -> proc_macro:: TokenStream {
11
11
let item = parse_macro_input ! ( input as Item ) ;
12
12
13
- match item {
13
+ let token_stream = match item {
14
14
Item :: Enum ( item) => drive_syntax_enum ( item) ,
15
15
Item :: Struct ( item) => drive_syntax_struct ( item) ,
16
16
_ => Error :: new ( item. span ( ) , "Syntax: unsupport type" )
17
17
. into_compile_error ( )
18
18
. into ( ) ,
19
- }
19
+ } ;
20
+
21
+ token_stream
20
22
}
21
23
22
24
fn syntax_error_type ( attrs : & [ Attribute ] ) -> Option < proc_macro2:: TokenStream > {
@@ -327,7 +329,7 @@ fn drive_syntax_struct(item: ItemStruct) -> proc_macro::TokenStream {
327
329
#[ proc_macro]
328
330
pub fn def_tuple_syntax ( _: proc_macro:: TokenStream ) -> proc_macro:: TokenStream {
329
331
let mut stmts = vec ! [ ] ;
330
- for i in 2 ..16 {
332
+ for i in 2 ..8 {
331
333
let mut types = vec ! [ ] ;
332
334
333
335
let mut pos = vec ! [ ] ;
@@ -531,7 +533,7 @@ pub fn tokens(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
531
533
let ident = & expr. expr ;
532
534
let ident_name = expr. expr . to_token_stream ( ) . to_string ( ) ;
533
535
534
- quote ! {
536
+ let token_stream = quote ! {
535
537
#( #stmts) *
536
538
537
539
#[ doc="Token parser" ]
@@ -557,5 +559,7 @@ pub fn tokens(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
557
559
}
558
560
}
559
561
}
560
- . into ( )
562
+ . into ( ) ;
563
+
564
+ token_stream
561
565
}
You can’t perform that action at this time.
0 commit comments