diff options
| author | Laurenz <laurmaedje@gmail.com> | 2020-10-04 20:22:11 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2020-10-04 20:22:11 +0200 |
| commit | ef8aa763faa59fd62c90c6d6245e8d2c5eece35e (patch) | |
| tree | d36192af0c770b076a5004ba8bcae3c2df728c75 /src/parse | |
| parent | a41d7ab47dda1e30465bdf91fd02bca0e634a38d (diff) | |
Shorten some names ↔
Diffstat (limited to 'src/parse')
| -rw-r--r-- | src/parse/mod.rs | 2 | ||||
| -rw-r--r-- | src/parse/parser.rs | 12 | ||||
| -rw-r--r-- | src/parse/tests.rs | 6 |
3 files changed, 10 insertions, 10 deletions
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<Diagnostic>) { - self.f.diagnostics.push(diag); + pub fn diag(&mut self, diag: Spanned<Diag>) { + 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<Decoration>) { - self.f.decorations.push(deco); + pub fn deco(&mut self, deco: Spanned<Deco>) { + 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::<Vec<_>>(); 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); }; } |
