|
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 |
|
@@ -80,7 +80,7 @@ impl ParserOptions { |
80 | 80 | /// |
81 | 81 | /// # Errors |
82 | 82 | /// This function may error if we could not read the reader or if the source code was somehow malformed. |
83 | | -pub fn parse<S: AsRef<str>>(source: S, pindex: &PackageIndex, options: &ParserOptions) -> Result<Program, Error> { |
| 83 | +pub fn parse<S: AsRef<str>>(source: S, _pindex: &PackageIndex, options: &ParserOptions) -> Result<Program, Error> { |
84 | 84 | let source: &str = source.as_ref(); |
85 | 85 |
|
86 | 86 | // Run that through the scanner |
@@ -117,21 +117,11 @@ pub fn parse<S: AsRef<str>>(source: S, pindex: &PackageIndex, options: &ParserOp |
117 | 117 | }, |
118 | 118 | }, |
119 | 119 |
|
120 | | - Language::Bakery => match bakery::parse_ast(tks, pindex.clone()) { |
121 | | - Ok(ast) => ast, |
122 | | - |
123 | | - Err(nom::Err::Error(e)) | Err(nom::Err::Failure(e)) => { |
124 | | - // Match the EOF-error |
125 | | - if e.errors[0].1 == VerboseErrorKind::Nom(nom::error::ErrorKind::Eof) { |
126 | | - return Err(Error::Eof { lang: Language::BraneScript, err: errors::convert_parser_error(tks, e) }); |
127 | | - } |
128 | | - return Err(Error::ParseError { lang: Language::Bakery, err: errors::convert_parser_error(tks, e) }); |
129 | | - }, |
130 | | - Err(err) => { |
131 | | - return Err(Error::ParserError { lang: Language::Bakery, err: format!("{err}") }); |
132 | | - }, |
| 120 | + Language::Bakery => { |
| 121 | + todo!("Support for the bakery language was removed as it was not functional anymore, this might be added back later"); |
133 | 122 | }, |
134 | 123 | }; |
| 124 | + |
135 | 125 | if remain.input_len() > 0 { |
136 | 126 | return Err(Error::LeftoverTokensError { lang: options.lang }); |
137 | 127 | } |
|
0 commit comments