Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix lexer for nighly after 2023-12-02 #86

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benches/csv/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pag-compiler = { path = "../../pag-compiler" }

[dev-dependencies]
csv = { version = "1" }
criterion = { version = "0.4", features = ["html_reports"] }
criterion = { version = "0.5", features = ["html_reports"] }
pest = { version = "2.5.7", features = [ "std", "memchr" ] }
pest_derive = "2.5.7"

Expand Down
4 changes: 2 additions & 2 deletions benches/json/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ pag-compiler = { path = "../../pag-compiler" }
lalrpop = "0.20.0"

[dev-dependencies]
criterion = { version = "0.4", features = ["html_reports"] }
criterion = { version = "0.5", features = ["html_reports"] }
snmalloc-rs = { version = "0.3", features = ["build_cc"] }
pest = { version = "2.5.7", features = [ "std", "memchr" ] }
pest_derive = "2.5.7"
lalrpop-util = { version = "0.20.0", features = ["lexer", "unicode"] }
logos = "0.13.0"
logos = "0.14.0"

[[bench]]
name = "benchmarks"
Expand Down
9 changes: 5 additions & 4 deletions pag-lexer/src/lookahead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,15 @@ fn generate_lookahead_routine(intervals: &Intervals, kind: Kind) -> TokenStream
mask.#count_act() / 8
}}
} else {
quote! {
(#x).to_bitmask().#count_act()
}
quote! {{
let mask = (#x).to_bitmask() as u16;
mask.#count_act()
}}
}
});
quote! {
for i in input[idx..].array_chunks::<16>() {
use core::simd::*;
use core::simd::prelude::*;
let data = u8x16::from_slice(i);
let idx_offset = #idx_offset;
idx += idx_offset as usize;
Expand Down
2 changes: 1 addition & 1 deletion pag-lexer/src/regex_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl RegexTree {
match self {
Set(intervals) if intervals.is_single_byte() => Some(vec![intervals.representative()]),
Concat(children) => {
let init = if let Some(x) = children.get(0) {
let init = if let Some(x) = children.first() {
x.as_byte_sequence()
} else {
return Some(Vec::new());
Expand Down
2 changes: 1 addition & 1 deletion pag-lexer/src/utilities.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ where
}
#[cfg(debug_assertions)]
{
let mut vec = Vec::from_iter(data.into_iter());
let mut vec = Vec::from_iter(data);
vec.sort_unstable_by_key(_f);
vec.into_iter()
}
Expand Down
4 changes: 2 additions & 2 deletions pag-parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pag-lexer = { version = "0.1.0-alpha.1", path = "../pag-lexer" }
typed-arena = "2.0.2"
quote = "1.0.26"
proc-macro2 = "1.0"
ariadne = { version = "0.3", features = ["auto-color"] }
ariadne = { version = "0.4", features = ["auto-color"] }

[dev-dependencies]
strip-ansi-escapes = "0.1.1"
strip-ansi-escapes = "0.2.0"
2 changes: 1 addition & 1 deletion pag-parser/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl<'src> Error<'src> {
Report::build(ReportKind::Error, input_name, span.start())
.with_message("Format error in grammar definition")
.with_label(Label::new((input_name, span.start()..span.end()))
.with_message(format!("{}", message))
.with_message(message.to_string())
.with_color(Color::Red))
.finish()
},
Expand Down
Loading