|
14 | 14 | // |
15 | 15 |
|
16 | 16 | use log::trace; |
17 | | -use nom::InputLength; |
18 | | -use nom::error::VerboseErrorKind; |
| 17 | +use nom::Input as _; |
| 18 | +use nom_language::error::VerboseErrorKind; |
19 | 19 | use specifications::package::PackageIndex; |
20 | 20 |
|
21 | 21 | use crate::errors; |
22 | 22 | pub use crate::errors::ParseError as Error; |
23 | 23 | use crate::parser::ast::Program; |
24 | | -use crate::parser::{bakery, bscript}; |
| 24 | +use crate::parser::bscript; |
25 | 25 | use crate::scanner::{self, Span, Token, Tokens}; |
26 | 26 | use crate::spec::Language; |
27 | 27 |
|
@@ -145,7 +145,7 @@ impl ParserOptions { |
145 | 145 | /// |
146 | 146 | /// # Errors |
147 | 147 | /// This function may error if we could not read the reader or if the source code was somehow malformed. |
148 | | -pub fn parse<S: AsRef<str>>(source: S, pindex: &PackageIndex, options: &ParserOptions) -> Result<Program, Error> { |
| 148 | +pub fn parse<S: AsRef<str>>(source: S, _pindex: &PackageIndex, options: &ParserOptions) -> Result<Program, Error> { |
149 | 149 | let source: &str = source.as_ref(); |
150 | 150 |
|
151 | 151 | // Run that through the scanner |
@@ -182,21 +182,11 @@ pub fn parse<S: AsRef<str>>(source: S, pindex: &PackageIndex, options: &ParserOp |
182 | 182 | }, |
183 | 183 | }, |
184 | 184 |
|
185 | | - Language::Bakery => match bakery::parse_ast(tks, pindex.clone()) { |
186 | | - Ok(ast) => ast, |
187 | | - |
188 | | - Err(nom::Err::Error(e)) | Err(nom::Err::Failure(e)) => { |
189 | | - // Match the EOF-error |
190 | | - if e.errors[0].1 == VerboseErrorKind::Nom(nom::error::ErrorKind::Eof) { |
191 | | - return Err(Error::Eof { lang: Language::BraneScript, err: errors::convert_parser_error(tks, e) }); |
192 | | - } |
193 | | - return Err(Error::ParseError { lang: Language::Bakery, err: errors::convert_parser_error(tks, e) }); |
194 | | - }, |
195 | | - Err(err) => { |
196 | | - return Err(Error::ParserError { lang: Language::Bakery, err: format!("{err}") }); |
197 | | - }, |
| 185 | + Language::Bakery => { |
| 186 | + todo!("Support for the bakery language was removed as it was not functional anymore, this might be added back later"); |
198 | 187 | }, |
199 | 188 | }; |
| 189 | + |
200 | 190 | if remain.input_len() > 0 { |
201 | 191 | return Err(Error::LeftoverTokensError { lang: options.lang }); |
202 | 192 | } |
|
0 commit comments