@@ -87,7 +87,7 @@ pub enum TopEntryPoint {
87
87
}
88
88
89
89
impl TopEntryPoint {
90
- pub fn parse ( & self , input : & Input ) -> Output {
90
+ pub fn parse ( & self , input : & Input , edition : Edition ) -> Output {
91
91
let _p = tracing:: span!( tracing:: Level :: INFO , "TopEntryPoint::parse" , ?self ) . entered ( ) ;
92
92
let entry_point: fn ( & ' _ mut parser:: Parser < ' _ > ) = match self {
93
93
TopEntryPoint :: SourceFile => grammar:: entry:: top:: source_file,
@@ -99,7 +99,7 @@ impl TopEntryPoint {
99
99
TopEntryPoint :: MetaItem => grammar:: entry:: top:: meta_item,
100
100
TopEntryPoint :: MacroEagerInput => grammar:: entry:: top:: eager_macro_input,
101
101
} ;
102
- let mut p = parser:: Parser :: new ( input, Edition :: Edition2021 ) ;
102
+ let mut p = parser:: Parser :: new ( input, edition ) ;
103
103
entry_point ( & mut p) ;
104
104
let events = p. finish ( ) ;
105
105
let res = event:: process ( events) ;
@@ -151,7 +151,7 @@ pub enum PrefixEntryPoint {
151
151
}
152
152
153
153
impl PrefixEntryPoint {
154
- pub fn parse ( & self , input : & Input ) -> Output {
154
+ pub fn parse ( & self , input : & Input , edition : Edition ) -> Output {
155
155
let entry_point: fn ( & ' _ mut parser:: Parser < ' _ > ) = match self {
156
156
PrefixEntryPoint :: Vis => grammar:: entry:: prefix:: vis,
157
157
PrefixEntryPoint :: Block => grammar:: entry:: prefix:: block,
@@ -164,7 +164,7 @@ impl PrefixEntryPoint {
164
164
PrefixEntryPoint :: Item => grammar:: entry:: prefix:: item,
165
165
PrefixEntryPoint :: MetaItem => grammar:: entry:: prefix:: meta_item,
166
166
} ;
167
- let mut p = parser:: Parser :: new ( input, Edition :: Edition2021 ) ;
167
+ let mut p = parser:: Parser :: new ( input, edition ) ;
168
168
entry_point ( & mut p) ;
169
169
let events = p. finish ( ) ;
170
170
event:: process ( events)
@@ -188,9 +188,9 @@ impl Reparser {
188
188
///
189
189
/// Tokens must start with `{`, end with `}` and form a valid brace
190
190
/// sequence.
191
- pub fn parse ( self , tokens : & Input ) -> Output {
191
+ pub fn parse ( self , tokens : & Input , edition : Edition ) -> Output {
192
192
let Reparser ( r) = self ;
193
- let mut p = parser:: Parser :: new ( tokens, Edition :: Edition2021 ) ;
193
+ let mut p = parser:: Parser :: new ( tokens, edition ) ;
194
194
r ( & mut p) ;
195
195
let events = p. finish ( ) ;
196
196
event:: process ( events)
0 commit comments