Skip to content

Commit 5b41afd

Browse files
committed
Merge origin/main
2 parents 7fd20da + 8ad89c8 commit 5b41afd

8 files changed

Lines changed: 12 additions & 8 deletions

File tree

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,5 @@ lto = "thin" # Similarly, speed up linking by a ton
2929
[workspace.dependencies]
3030
edit = { path = "./crates/edit" }
3131
lsh = { path = "./crates/lsh" }
32-
lsh-bin = { path = "./crates/lsh-bin" }
3332
stdext = { path = "./crates/stdext" }
3433
unicode-gen = { path = "./crates/unicode-gen" }

crates/edit/src/bin/edit/settings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl Settings {
5656
if let Some(f) = root.get_object("fileAssociations") {
5757
for &(mut key, ref value) in f.iter() {
5858
if !key.contains('/') {
59-
key = arena_format!(&scratch, "**/{key}").leak();
59+
key = arena_format!(&*scratch, "**/{key}").leak();
6060
}
6161

6262
let Some(id) = value.as_str() else {

crates/edit/src/lsh/highlighter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ impl<'doc> Highlighter<'doc> {
7474
let mut res = self.runtime.parse_next_line(arena, line);
7575

7676
// Adjust the range to account for the line offset.
77-
for h in &mut res {
77+
for h in res.iter_mut() {
7878
h.start = line_beg + h.start.min(line.len());
7979
}
8080

crates/lsh/src/compiler/backend.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,8 @@ impl<'a> Backend<'a> {
350350

351351
ir = next.borrow_mut();
352352

353+
// If the next instruction was already serialized (e.g. this is some form of loop),
354+
// simply jump to the already serialized code. We're done here. Nothing new will come after this.
353355
if ir.offset != usize::MAX {
354356
self.push_instruction(MovImm {
355357
dst: Register::ProgramCounter,
@@ -520,6 +522,7 @@ impl<'a> LivenessAnalysis<'a> {
520522

521523
let ir = cell.borrow();
522524

525+
#[allow(clippy::collapsible_match)]
523526
match ir.instr {
524527
IRI::Mov { dst, src } => {
525528
if dst.borrow().physical.is_none() {

crates/lsh/src/compiler/frontend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ impl<'a, 'c, 'src> Parser<'a, 'c, 'src> {
643643
lhs_span.last.borrow_mut().set_next(add_ir);
644644
Ok((IRSpan { first: lhs_span.first, last: add_ir }, lhs_vreg))
645645
} else if lhs_vreg.borrow().physical.is_some() {
646-
// For expressions of type `var virtual = phyiscal;`, we need to ensure
646+
// For expressions of type `var virtual = physical;`, we need to ensure
647647
// that we actually copy the physical register into a new virtual one.
648648
// The remaining code assumes single assignment form, while physical registers are permanent.
649649
let dst = self.compiler.alloc_vreg();

crates/lsh/src/compiler/generator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
//!
66
//! ## TODO
77
//!
8-
//! - The label lookup (with a `HashMap`) is just plain dumb.
8+
//! - The label lookup (with a `HashMap`) is $NOT_GREAT.
99
//! The backend should emit metadata, I think.
1010
1111
use std::collections::HashMap;

crates/lsh/src/compiler/optimizer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ fn optimize_redundant_offset_backup_restore<'a>(compiler: &mut Compiler<'a>) {
157157
optimize_noop(compiler);
158158
}
159159

160-
/// This isn't an optimization for the VM, it's one for my autistic side.
160+
/// This isn't an optimization for the VM, it's one for my pedantic side.
161161
/// I like it if the identifiers are sorted and the values contiguous.
162162
fn optimize_highlight_kind_values<'a>(compiler: &mut Compiler<'a>) {
163163
let scratch = scratch_arena(None);

crates/lsh/src/compiler/regex.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,10 @@ impl<'a> RegexParser<'a> {
412412
let mut charset = Charset::no();
413413

414414
// First char can be ] or - literally
415-
if self.peek() == Some(']') {
416-
charset.set(b']', true);
415+
if let Some(ch) = self.peek()
416+
&& matches!(ch, ']' | '-')
417+
{
418+
charset.set(ch as u8, true);
417419
self.advance();
418420
}
419421

0 commit comments

Comments
 (0)