From a056a7b3716bd4cc78e47e64f7d735c5bd5b82e6 Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Wed, 29 Jun 2022 17:15:17 +0200 Subject: Fix a bunch of bugs with definitions, references * Fix bug where whitespace after `:` was not allowed, it is * Fix bug where escapes in labels did not work due to typo * Fix to prefer first definition * Fix whitespace after definitions * Fix matching by adding normalizing * Fix reference from being output as data --- src/construct/definition.rs | 2 +- src/construct/partial_label.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/construct') diff --git a/src/construct/definition.rs b/src/construct/definition.rs index 5e80a93..aca22a6 100644 --- a/src/construct/definition.rs +++ b/src/construct/definition.rs @@ -149,7 +149,7 @@ fn label_after(tokenizer: &mut Tokenizer, code: Code) -> StateFnResult { tokenizer.exit(TokenType::DefinitionMarker); ( State::Fn(Box::new( - tokenizer.go(space_or_tab_one_line_ending(), destination_before), + tokenizer.attempt_opt(space_or_tab_one_line_ending(), destination_before), )), None, ) diff --git a/src/construct/partial_label.rs b/src/construct/partial_label.rs index 2e8e950..1e4d7f2 100644 --- a/src/construct/partial_label.rs +++ b/src/construct/partial_label.rs @@ -181,7 +181,7 @@ fn label(tokenizer: &mut Tokenizer, code: Code, mut info: Info) -> StateFnResult info.size += 1; (State::Fn(Box::new(|t, c| label(t, c, info))), None) } - Code::Char('/') => { + Code::Char('\\') => { tokenizer.consume(code); info.size += 1; if !info.data { -- cgit