From f893e24aed5e2e3a9c18bf60a8d2ac8d7fca70c2 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 6b7fd111..cf70565a 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 36a065e3..cfa1b34f 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)) ); } }