From beffef80c624cf693054a214105a1a22401e5d1d Mon Sep 17 00:00:00 2001 From: Erin Date: Mon, 7 Jun 2021 21:28:24 +0200 Subject: [PATCH] Changed position terminology --- src/main.rs | 5 +++-- src/repl.rs | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6b7fd11..cf70565 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ #![forbid(unsafe_code)] +mod ast; mod base_55; mod brian; mod error; @@ -48,8 +49,8 @@ fn main() { println!( "Error `{:?}` occurred at span: {:?} = `{:?}`", e.kind, - e.position.clone(), - source.slice(e.position) + e.span.clone(), + source.slice(e.span) ); } } diff --git a/src/repl.rs b/src/repl.rs index 36a065e..cfa1b34 100644 --- a/src/repl.rs +++ b/src/repl.rs @@ -25,15 +25,15 @@ pub fn repl() { println!( "Error `{:?}` occurred at span: {:?} = `{:?}`", e.kind, - e.position.clone(), - line.slice(e.position.clone()) + e.span.clone(), + line.slice(e.span.clone()) ); println!(" | {}", line); println!( " {}{}-- Here", - " ".repeat(e.position.start), - "^".repeat((e.position.end - e.position.start).max(1)) + " ".repeat(e.span.start), + "^".repeat((e.span.end - e.span.start).max(1)) ); } }