keep concrete types

pull/752/head
Yuri Astrakhan 11 months ago committed by Thomas Tanon
parent 185d83838c
commit 6494ba6e31
  1. 2
      lib/oxttl/src/lexer.rs
  2. 10
      lib/oxttl/src/line_formats.rs
  3. 8
      lib/oxttl/src/n3.rs
  4. 8
      lib/oxttl/src/terse.rs

@ -57,7 +57,7 @@ impl TokenRecognizer for N3Lexer {
data: &'a [u8],
is_ending: bool,
options: &Self::Options,
) -> Option<(usize, Result<Self::Token<'a>, TokenRecognizerError>)> {
) -> Option<(usize, Result<N3Token<'a>, TokenRecognizerError>)> {
match *data.first()? {
b'<' => match *data.get(1)? {
b'<' => Some((2, Ok(N3Token::Punctuation("<<")))),

@ -54,8 +54,8 @@ impl RuleRecognizer for NQuadsRecognizer {
fn recognize_next(
mut self,
token: N3Token<'_>,
context: &mut Self::Context,
results: &mut Vec<Self::Output>,
context: &mut NQuadsRecognizerContext,
results: &mut Vec<Quad>,
errors: &mut Vec<RuleRecognizerError>,
) -> Self {
if let Some(state) = self.stack.pop() {
@ -235,8 +235,8 @@ impl RuleRecognizer for NQuadsRecognizer {
fn recognize_end(
mut self,
_context: &mut Self::Context,
results: &mut Vec<Self::Output>,
_context: &mut NQuadsRecognizerContext,
results: &mut Vec<Quad>,
errors: &mut Vec<RuleRecognizerError>,
) {
match &*self.stack {
@ -255,7 +255,7 @@ impl RuleRecognizer for NQuadsRecognizer {
}
}
fn lexer_options(context: &Self::Context) -> &N3LexerOptions {
fn lexer_options(context: &NQuadsRecognizerContext) -> &N3LexerOptions {
&context.lexer_options
}
}

@ -722,8 +722,8 @@ impl RuleRecognizer for N3Recognizer {
fn recognize_next(
mut self,
token: N3Token<'_>,
context: &mut Self::Context,
results: &mut Vec<Self::Output>,
context: &mut N3RecognizerContext,
results: &mut Vec<N3Quad>,
errors: &mut Vec<RuleRecognizerError>,
) -> Self {
while let Some(rule) = self.stack.pop() {
@ -1195,7 +1195,7 @@ impl RuleRecognizer for N3Recognizer {
fn recognize_end(
self,
_state: &mut Self::Context,
_state: &mut N3RecognizerContext,
_results: &mut Vec<Self::Output>,
errors: &mut Vec<RuleRecognizerError>,
) {
@ -1205,7 +1205,7 @@ impl RuleRecognizer for N3Recognizer {
}
}
fn lexer_options(context: &Self::Context) -> &N3LexerOptions {
fn lexer_options(context: &N3RecognizerContext) -> &N3LexerOptions {
&context.lexer_options
}
}

@ -44,8 +44,8 @@ impl RuleRecognizer for TriGRecognizer {
fn recognize_next(
mut self,
token: N3Token<'_>,
context: &mut Self::Context,
results: &mut Vec<Self::Output>,
context: &mut TriGRecognizerContext,
results: &mut Vec<Quad>,
errors: &mut Vec<RuleRecognizerError>,
) -> Self {
if let Some(rule) = self.stack.pop() {
@ -792,7 +792,7 @@ impl RuleRecognizer for TriGRecognizer {
fn recognize_end(
mut self,
_context: &mut Self::Context,
_context: &mut TriGRecognizerContext,
results: &mut Vec<Self::Output>,
errors: &mut Vec<RuleRecognizerError>,
) {
@ -821,7 +821,7 @@ impl RuleRecognizer for TriGRecognizer {
}
}
fn lexer_options(context: &Self::Context) -> &N3LexerOptions {
fn lexer_options(context: &TriGRecognizerContext) -> &N3LexerOptions {
&context.lexer_options
}
}

Loading…
Cancel
Save