Skip to content

Commit 9c7b7ea

Browse files
chore(deps): Bump nom to version 8
1 parent 6bcfa3c commit 9c7b7ea

File tree

12 files changed

+105
-356
lines changed

12 files changed

+105
-356
lines changed

Cargo.lock

Lines changed: 39 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

brane-dsl/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ license.workspace = true
1010
[dependencies]
1111
enum-debug.workspace = true
1212
log = "0.4.22"
13-
nom = "7.1.0"
14-
nom_locate = "4.1.0"
13+
nom = "8.0.0"
14+
nom_locate = "5.0.0"
15+
nom-language = "0.1.0"
1516
rand = "0.9.0"
1617
regex = "1.5.0"
1718
serde = "1.0.204"

brane-dsl/src/compiler.rs

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
//
1515

1616
use log::trace;
17-
use nom::InputLength;
18-
use nom::error::VerboseErrorKind;
17+
use nom::Input as _;
18+
use nom_language::error::VerboseErrorKind;
1919
use specifications::package::PackageIndex;
2020

2121
use crate::errors;
2222
pub use crate::errors::ParseError as Error;
2323
use crate::parser::ast::Program;
24-
use crate::parser::{bakery, bscript};
24+
use crate::parser::bscript;
2525
use crate::scanner::{self, Span, Token, Tokens};
2626
use crate::spec::Language;
2727

@@ -80,7 +80,7 @@ impl ParserOptions {
8080
///
8181
/// # Errors
8282
/// 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> {
8484
let source: &str = source.as_ref();
8585

8686
// Run that through the scanner
@@ -117,21 +117,11 @@ pub fn parse<S: AsRef<str>>(source: S, pindex: &PackageIndex, options: &ParserOp
117117
},
118118
},
119119

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");
133122
},
134123
};
124+
135125
if remain.input_len() > 0 {
136126
return Err(Error::LeftoverTokensError { lang: options.lang });
137127
}

brane-dsl/src/errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use std::error::Error;
1717
use std::fmt::{Display, Formatter, Result as FResult};
1818

19-
use nom::error::{VerboseError, VerboseErrorKind};
19+
use nom_language::error::{VerboseError, VerboseErrorKind};
2020

2121
use crate::scanner::{Span, Tokens};
2222
use crate::spec::{Language, TextRange};

0 commit comments

Comments
 (0)