From ef8aa763faa59fd62c90c6d6245e8d2c5eece35e Mon Sep 17 00:00:00 2001 From: Laurenz Date: Sun, 4 Oct 2020 20:22:11 +0200 Subject: =?UTF-8?q?Shorten=20some=20names=20=E2=86=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/parse/mod.rs | 2 +- src/parse/parser.rs | 12 ++++++------ src/parse/tests.rs | 6 +++--- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/parse') diff --git a/src/parse/mod.rs b/src/parse/mod.rs index 916f2fdc..ca2375f2 100644 --- a/src/parse/mod.rs +++ b/src/parse/mod.rs @@ -246,7 +246,7 @@ fn dict_contents(p: &mut Parser) -> (LitDict, bool) { if let Some(key) = &entry.key { comma_and_keyless = false; - p.deco(Decoration::DictKey.span_with(key.span)); + p.deco(Deco::DictKey.span_with(key.span)); } let behind = entry.expr.span.end; diff --git a/src/parse/parser.rs b/src/parse/parser.rs index 041a61bc..83e9b096 100644 --- a/src/parse/parser.rs +++ b/src/parse/parser.rs @@ -1,8 +1,8 @@ use std::fmt::{self, Debug, Formatter}; use super::{Scanner, TokenMode, Tokens}; -use crate::diagnostic::Diagnostic; -use crate::syntax::{Decoration, Pos, Span, SpanWith, Spanned, Token}; +use crate::diag::Diag; +use crate::syntax::{Deco, Pos, Span, SpanWith, Spanned, Token}; use crate::Feedback; /// A convenient token-based parser. @@ -34,8 +34,8 @@ impl<'s> Parser<'s> { } /// Add a diagnostic to the feedback. - pub fn diag(&mut self, diag: Spanned) { - self.f.diagnostics.push(diag); + pub fn diag(&mut self, diag: Spanned) { + self.f.diags.push(diag); } /// Eat the next token and add a diagnostic that it was not the expected @@ -66,8 +66,8 @@ impl<'s> Parser<'s> { } /// Add a decoration to the feedback. - pub fn deco(&mut self, deco: Spanned) { - self.f.decorations.push(deco); + pub fn deco(&mut self, deco: Spanned) { + self.f.decos.push(deco); } /// Update the token mode and push the previous mode onto a stack. diff --git a/src/parse/tests.rs b/src/parse/tests.rs index 21375a0f..6738998a 100644 --- a/src/parse/tests.rs +++ b/src/parse/tests.rs @@ -12,7 +12,7 @@ use crate::syntax::*; // ------------------------------ Construct Syntax Nodes ------------------------------ // -use Decoration::*; +use Deco::*; use SynNode::{Emph as E, Linebreak as L, Parbreak as P, Space as S, Strong as B}; fn T(text: &str) -> SynNode { @@ -160,7 +160,7 @@ macro_rules! e { ($src:expr => $($tts:tt)*) => { let exp = vec![$($tts)*]; let pass = parse($src); - let found = pass.feedback.diagnostics.iter() + let found = pass.feedback.diags.iter() .map(|s| s.as_ref().map(|e| e.message.as_str())) .collect::>(); check($src, exp, found, true); @@ -172,7 +172,7 @@ macro_rules! d { ($src:expr => $($tts:tt)*) => { let exp = vec![$($tts)*]; let pass = parse($src); - check($src, exp, pass.feedback.decorations, true); + check($src, exp, pass.feedback.decos, true); }; } -- cgit v1.2.3