summaryrefslogtreecommitdiff
path: root/src/parser.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser.rs')
-rw-r--r--src/parser.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/parser.rs b/src/parser.rs
index 59ba111..81eda42 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -1,4 +1,4 @@
-use crate::error::SiteError;
+use crate::error::RikiError;
use crate::token::{TokenKind, TokenParser, TokenPatterns};
use crate::wikitext::{ParsedDirective, Snippet, WikiLink};
use line_col::LineColLookup;
@@ -44,7 +44,7 @@ impl WikitextParser {
self.tokens.is_empty()
}
- pub fn parse(&mut self) -> Result<Option<Snippet>, SiteError> {
+ pub fn parse(&mut self) -> Result<Option<Snippet>, RikiError> {
if self.is_empty() {
return Ok(None);
}
@@ -110,7 +110,7 @@ impl WikitextParser {
self.drain(3);
break;
}
- _ => return Err(SiteError::wikitext_syntax(line, col, &self.tokens[..5])),
+ _ => return Err(RikiError::wikitext_syntax(line, col, &self.tokens[..5])),
}
}
if target.is_none() {
@@ -163,7 +163,7 @@ impl WikitextParser {
args.insert(value.to_string(), "".to_string());
self.drain(1);
}
- _ => return Err(SiteError::wikitext_syntax(line, col, &self.tokens[..5])),
+ _ => return Err(RikiError::wikitext_syntax(line, col, &self.tokens[..5])),
}
}
Snippet::Directive(ParsedDirective::new(&name, args)?)
@@ -199,7 +199,7 @@ impl WikitextParser {
break;
}
_ => {
- return Err(SiteError::wikitext_syntax(
+ return Err(RikiError::wikitext_syntax(
line,
col,
&self.tokens[..std::cmp::min(5, self.tokens.len())],
@@ -279,7 +279,7 @@ impl WikitextParser {
self.drain(1);
Snippet::Markdown("]]".into())
}
- _ => return Err(SiteError::wikitext_syntax(line, col, &self.tokens[..5])),
+ _ => return Err(RikiError::wikitext_syntax(line, col, &self.tokens[..5])),
};
Ok(Some(snippet))
}