@@ -87,7 +87,7 @@ pub enum TopEntryPoint {
8787}
8888
8989impl TopEntryPoint {
90- pub fn parse ( & self , input : & Input ) -> Output {
90+ pub fn parse ( & self , input : & Input , edition : Edition ) -> Output {
9191 let _p = tracing:: span!( tracing:: Level :: INFO , "TopEntryPoint::parse" , ?self ) . entered ( ) ;
9292 let entry_point: fn ( & ' _ mut parser:: Parser < ' _ > ) = match self {
9393 TopEntryPoint :: SourceFile => grammar:: entry:: top:: source_file,
@@ -99,7 +99,7 @@ impl TopEntryPoint {
9999 TopEntryPoint :: MetaItem => grammar:: entry:: top:: meta_item,
100100 TopEntryPoint :: MacroEagerInput => grammar:: entry:: top:: eager_macro_input,
101101 } ;
102- let mut p = parser:: Parser :: new ( input, Edition :: Edition2021 ) ;
102+ let mut p = parser:: Parser :: new ( input, edition ) ;
103103 entry_point ( & mut p) ;
104104 let events = p. finish ( ) ;
105105 let res = event:: process ( events) ;
@@ -151,7 +151,7 @@ pub enum PrefixEntryPoint {
151151}
152152
153153impl PrefixEntryPoint {
154- pub fn parse ( & self , input : & Input ) -> Output {
154+ pub fn parse ( & self , input : & Input , edition : Edition ) -> Output {
155155 let entry_point: fn ( & ' _ mut parser:: Parser < ' _ > ) = match self {
156156 PrefixEntryPoint :: Vis => grammar:: entry:: prefix:: vis,
157157 PrefixEntryPoint :: Block => grammar:: entry:: prefix:: block,
@@ -164,7 +164,7 @@ impl PrefixEntryPoint {
164164 PrefixEntryPoint :: Item => grammar:: entry:: prefix:: item,
165165 PrefixEntryPoint :: MetaItem => grammar:: entry:: prefix:: meta_item,
166166 } ;
167- let mut p = parser:: Parser :: new ( input, Edition :: Edition2021 ) ;
167+ let mut p = parser:: Parser :: new ( input, edition ) ;
168168 entry_point ( & mut p) ;
169169 let events = p. finish ( ) ;
170170 event:: process ( events)
@@ -188,9 +188,9 @@ impl Reparser {
188188 ///
189189 /// Tokens must start with `{`, end with `}` and form a valid brace
190190 /// sequence.
191- pub fn parse ( self , tokens : & Input ) -> Output {
191+ pub fn parse ( self , tokens : & Input , edition : Edition ) -> Output {
192192 let Reparser ( r) = self ;
193- let mut p = parser:: Parser :: new ( tokens, Edition :: Edition2021 ) ;
193+ let mut p = parser:: Parser :: new ( tokens, edition ) ;
194194 r ( & mut p) ;
195195 let events = p. finish ( ) ;
196196 event:: process ( events)
0 commit comments