Skip to content

Commit d9453b4

Browse files
committed
v0.9.2
1 parent 2d05feb commit d9453b4

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ This project adheres to [Semantic Versioning](https://semver.org).
88
Note: In this file, do not use the hard wrap in the middle of a sentence for compatibility with GitHub comment style markdown rendering.
99
-->
1010

11+
## [0.9.2] - 2025-07-01
12+
13+
- Syntax: add `Or` struct,
14+
1115
## [0.9.1] - 2025-06-23
1216

1317
- Broken changes: redesign `Span`,

core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2024"
55
license = "MIT"
66
name = "parserc"
77
repository = "https://github.com/styles-lab/parserc"
8-
version = "0.9.1"
8+
version = "0.9.2"
99

1010
[dependencies]
1111
memchr = "^2.7"

derive/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2024"
55
license = "MIT"
66
name = "parserc-derive"
77
repository = "https://github.com/styles-lab/parserc"
8-
version = "0.9.1"
8+
version = "0.9.2"
99

1010
[dependencies]
1111
proc-macro2 = "^1"

derive/src/lib.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ use syn::{
1010
pub fn derive_syntax_trait(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
1111
let item = parse_macro_input!(input as Item);
1212

13-
match item {
13+
let token_stream = match item {
1414
Item::Enum(item) => drive_syntax_enum(item),
1515
Item::Struct(item) => drive_syntax_struct(item),
1616
_ => Error::new(item.span(), "Syntax: unsupport type")
1717
.into_compile_error()
1818
.into(),
19-
}
19+
};
20+
21+
token_stream
2022
}
2123

2224
fn syntax_error_type(attrs: &[Attribute]) -> Option<proc_macro2::TokenStream> {
@@ -327,7 +329,7 @@ fn drive_syntax_struct(item: ItemStruct) -> proc_macro::TokenStream {
327329
#[proc_macro]
328330
pub fn def_tuple_syntax(_: proc_macro::TokenStream) -> proc_macro::TokenStream {
329331
let mut stmts = vec![];
330-
for i in 2..16 {
332+
for i in 2..8 {
331333
let mut types = vec![];
332334

333335
let mut pos = vec![];
@@ -531,7 +533,7 @@ pub fn tokens(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
531533
let ident = &expr.expr;
532534
let ident_name = expr.expr.to_token_stream().to_string();
533535

534-
quote! {
536+
let token_stream = quote! {
535537
#(#stmts)*
536538

537539
#[doc="Token parser"]
@@ -557,5 +559,7 @@ pub fn tokens(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
557559
}
558560
}
559561
}
560-
.into()
562+
.into();
563+
564+
token_stream
561565
}

0 commit comments

Comments
 (0)