diff options
Diffstat (limited to 'support/texlab/src/parser')
115 files changed, 888 insertions, 1354 deletions
diff --git a/support/texlab/src/parser/latex.rs b/support/texlab/src/parser/latex.rs index a103561685..591d2a1583 100644 --- a/support/texlab/src/parser/latex.rs +++ b/support/texlab/src/parser/latex.rs @@ -4,7 +4,10 @@ use rowan::{GreenNode, GreenNodeBuilder}; use crate::syntax::latex::SyntaxKind::{self, *}; -use self::lexer::Lexer; +use self::lexer::{ + types::{CommandName, SectionLevel, Token}, + Lexer, +}; #[derive(Debug, Clone, Copy)] struct ParserContext { @@ -40,20 +43,18 @@ impl<'a> Parser<'a> { self.builder.token(kind.into(), text); } - fn peek(&self) -> Option<SyntaxKind> { + fn peek(&self) -> Option<Token> { self.lexer.peek() } - fn expect(&mut self, kind: SyntaxKind) { + fn expect(&mut self, kind: Token) { if self.peek() == Some(kind) { self.eat(); self.trivia(); - } else { - self.builder.token(MISSING.into(), ""); } } - fn expect2(&mut self, kind1: SyntaxKind, kind2: SyntaxKind) { + fn expect2(&mut self, kind1: Token, kind2: Token) { if self .peek() .filter(|&kind| kind == kind1 || kind == kind2) @@ -61,17 +62,16 @@ impl<'a> Parser<'a> { { self.eat(); self.trivia(); - } else { - self.builder.token(MISSING.into(), ""); } } fn trivia(&mut self) { - while self - .peek() - .filter(|&kind| matches!(kind, LINE_BREAK | WHITESPACE | COMMENT)) - .is_some() - { + while self.peek().map_or(false, |kind| { + matches!( + kind, + Token::LineBreak | Token::Whitespace | Token::LineComment + ) + }) { self.eat(); } } @@ -88,66 +88,60 @@ impl<'a> Parser<'a> { fn content(&mut self, context: ParserContext) { match self.peek().unwrap() { - LINE_BREAK | WHITESPACE | COMMENT | VERBATIM => self.eat(), - L_CURLY if context.allow_environment => self.curly_group(), - L_CURLY => self.curly_group_without_environments(), - L_BRACK | L_PAREN => self.mixed_group(), - R_CURLY | R_BRACK | R_PAREN => { + Token::LineBreak | Token::Whitespace | Token::LineComment => self.eat(), + Token::LCurly if context.allow_environment => self.curly_group(), + Token::LCurly => self.curly_group_without_environments(), + Token::LBrack | Token::LParen => self.mixed_group(), + Token::RCurly | Token::RBrack | Token::RParen => { self.builder.start_node(ERROR.into()); self.eat(); self.builder.finish_node(); } - WORD | COMMA => self.text(context), - EQUALITY_SIGN => self.eat(), - DOLLAR => self.formula(), - GENERIC_COMMAND_NAME => self.generic_command(), - BEGIN_ENVIRONMENT_NAME if context.allow_environment => self.environment(), - BEGIN_ENVIRONMENT_NAME => self.generic_command(), - END_ENVIRONMENT_NAME => self.generic_command(), - BEGIN_EQUATION_NAME => self.equation(), - END_EQUATION_NAME => self.generic_command(), - MISSING | ERROR => self.eat(), - PART_NAME => self.part(), - CHAPTER_NAME => self.chapter(), - SECTION_NAME => self.section(), - SUBSECTION_NAME => self.subsection(), - SUBSUBSECTION_NAME => self.subsubsection(), - PARAGRAPH_NAME => self.paragraph(), - SUBPARAGRAPH_NAME => self.subparagraph(), - ENUM_ITEM_NAME => self.enum_item(), - CAPTION_NAME => self.caption(), - CITATION_NAME => self.citation(), - PACKAGE_INCLUDE_NAME => self.package_include(), - CLASS_INCLUDE_NAME => self.class_include(), - LATEX_INCLUDE_NAME => self.latex_include(), - BIBLATEX_INCLUDE_NAME => self.biblatex_include(), - BIBTEX_INCLUDE_NAME => self.bibtex_include(), - GRAPHICS_INCLUDE_NAME => self.graphics_include(), - SVG_INCLUDE_NAME => self.svg_include(), - INKSCAPE_INCLUDE_NAME => self.inkscape_include(), - VERBATIM_INCLUDE_NAME => self.verbatim_include(), - IMPORT_NAME => self.import(), - LABEL_DEFINITION_NAME => self.label_definition(), - LABEL_REFERENCE_NAME => self.label_reference(), - LABEL_REFERENCE_RANGE_NAME => self.label_reference_range(), - LABEL_NUMBER_NAME => self.label_number(), - COMMAND_DEFINITION_NAME => self.command_definition(), - MATH_OPERATOR_NAME => self.math_operator(), - GLOSSARY_ENTRY_DEFINITION_NAME => self.glossary_entry_definition(), - GLOSSARY_ENTRY_REFERENCE_NAME => self.glossary_entry_reference(), - ACRONYM_DEFINITION_NAME => self.acronym_definition(), - ACRONYM_DECLARATION_NAME => self.acronym_declaration(), - ACRONYM_REFERENCE_NAME => self.acronym_reference(), - THEOREM_DEFINITION_NAME => self.theorem_definition(), - COLOR_REFERENCE_NAME => self.color_reference(), - COLOR_DEFINITION_NAME => self.color_definition(), - COLOR_SET_DEFINITION_NAME => self.color_set_definition(), - TIKZ_LIBRARY_IMPORT_NAME => self.tikz_library_import(), - ENVIRONMENT_DEFINITION_NAME => self.environment_definition(), - BEGIN_BLOCK_COMMENT_NAME => self.block_comment(), - END_BLOCK_COMMENT_NAME => self.generic_command(), - GRAPHICS_PATH_NAME => self.graphics_path(), - _ => unreachable!(), + Token::Word | Token::Comma => self.text(context), + Token::Eq => self.eat(), + Token::Dollar => self.formula(), + Token::CommandName(name) => match name { + CommandName::Generic => self.generic_command(), + CommandName::BeginEnvironment if context.allow_environment => self.environment(), + CommandName::BeginEnvironment => self.generic_command(), + CommandName::EndEnvironment => self.generic_command(), + CommandName::BeginEquation => self.equation(), + CommandName::EndEquation => self.generic_command(), + CommandName::Section(level) => self.section(level), + CommandName::EnumItem => self.enum_item(), + CommandName::Caption => self.caption(), + CommandName::Citation => self.citation(), + CommandName::PackageInclude => self.package_include(), + CommandName::ClassInclude => self.class_include(), + CommandName::LatexInclude => self.latex_include(), + CommandName::BiblatexInclude => self.biblatex_include(), + CommandName::BibtexInclude => self.bibtex_include(), + CommandName::GraphicsInclude => self.graphics_include(), + CommandName::SvgInclude => self.svg_include(), + CommandName::InkscapeInclude => self.inkscape_include(), + CommandName::VerbatimInclude => self.verbatim_include(), + CommandName::Import => self.import(), + CommandName::LabelDefinition => self.label_definition(), + CommandName::LabelReference => self.label_reference(), + CommandName::LabelReferenceRange => self.label_reference_range(), + CommandName::LabelNumber => self.label_number(), + CommandName::CommandDefinition => self.command_definition(), + CommandName::MathOperator => self.math_operator(), + CommandName::GlossaryEntryDefinition => self.glossary_entry_definition(), + CommandName::GlossaryEntryReference => self.glossary_entry_reference(), + CommandName::AcronymDefinition => self.acronym_definition(), + CommandName::AcronymDeclaration => self.acronym_declaration(), + CommandName::AcronymReference => self.acronym_reference(), + CommandName::TheoremDefinition => self.theorem_definition(), + CommandName::ColorReference => self.color_reference(), + CommandName::ColorDefinition => self.color_definition(), + CommandName::ColorSetDefinition => self.color_set_definition(), + CommandName::TikzLibraryImport => self.tikz_library_import(), + CommandName::EnvironmentDefinition => self.environment_definition(), + CommandName::BeginBlockComment => self.block_comment(), + CommandName::EndBlockComment => self.generic_command(), + CommandName::GraphicsPath => self.graphics_path(), + }, } } @@ -157,8 +151,14 @@ impl<'a> Parser<'a> { while self .peek() .filter(|&kind| { - matches!(kind, LINE_BREAK | WHITESPACE | COMMENT | WORD | COMMA) - && (context.allow_comma || kind != COMMA) + matches!( + kind, + Token::LineBreak + | Token::Whitespace + | Token::LineComment + | Token::Word + | Token::Comma + ) && (context.allow_comma || kind != Token::Comma) }) .is_some() { @@ -172,12 +172,12 @@ impl<'a> Parser<'a> { self.eat(); while self .peek() - .filter(|&kind| !matches!(kind, R_CURLY)) + .filter(|&kind| !matches!(kind, Token::RCurly)) .is_some() { self.content(ParserContext::default()); } - self.expect(R_CURLY); + self.expect(Token::RCurly); self.builder.finish_node(); } @@ -186,13 +186,13 @@ impl<'a> Parser<'a> { self.eat(); while let Some(kind) = self.peek() { match kind { - R_CURLY => break, - BEGIN_ENVIRONMENT_NAME => self.begin(), - END_ENVIRONMENT_NAME => self.end(), + Token::RCurly => break, + Token::CommandName(CommandName::BeginEnvironment) => self.begin(), + Token::CommandName(CommandName::EndEnvironment) => self.end(), _ => self.content(ParserContext::default()), }; } - self.expect(R_CURLY); + self.expect(Token::RCurly); self.builder.finish_node(); } @@ -201,7 +201,7 @@ impl<'a> Parser<'a> { self.eat(); while self .peek() - .filter(|&kind| !matches!(kind, R_CURLY)) + .filter(|&kind| !matches!(kind, Token::RCurly)) .is_some() { self.content(ParserContext { @@ -209,7 +209,7 @@ impl<'a> Parser<'a> { allow_comma: true, }); } - self.expect(R_CURLY); + self.expect(Token::RCurly); self.builder.finish_node(); } @@ -218,17 +218,15 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); match self.peek() { - Some(WORD) => { + Some(Token::Word) => { self.key(); } - Some(kind) if kind.is_command_name() => { + Some(Token::CommandName(_)) => { self.content(ParserContext::default()); } - Some(_) | None => { - self.builder.token(MISSING.into(), ""); - } + Some(_) | None => {} } - self.expect(R_CURLY); + self.expect(Token::RCurly); self.builder.finish_node(); } @@ -238,17 +236,26 @@ impl<'a> Parser<'a> { while self .peek() - .filter(|&kind| matches!(kind, LINE_BREAK | WHITESPACE | COMMENT | WORD | COMMA)) + .filter(|&kind| { + matches!( + kind, + Token::LineBreak + | Token::Whitespace + | Token::LineComment + | Token::Word + | Token::Comma + ) + }) .is_some() { - if self.peek() == Some(WORD) { + if self.peek() == Some(Token::Word) { self.key(); } else { self.eat(); } } - self.expect(R_CURLY); + self.expect(Token::RCurly); self.builder.finish_node(); } @@ -256,44 +263,32 @@ impl<'a> Parser<'a> { self.builder.start_node(CURLY_GROUP_COMMAND.into()); self.eat(); self.trivia(); - match self.peek() { - Some(kind) if kind.is_command_name() => { - self.eat(); - self.trivia(); - } - Some(_) | None => { - self.builder.token(MISSING.into(), ""); - } + if matches!(self.peek(), Some(Token::CommandName(_))) { + self.eat(); + self.trivia(); } - self.expect(R_CURLY); + + self.expect(Token::RCurly); self.builder.finish_node(); } fn brack_group(&mut self) { self.builder.start_node(BRACK_GROUP.into()); self.eat(); - while self - .peek() - .filter(|&kind| { - !matches!( - kind, - R_CURLY - | R_BRACK - | PART_NAME - | CHAPTER_NAME - | SECTION_NAME - | SUBSECTION_NAME - | PARAGRAPH_NAME - | SUBPARAGRAPH_NAME - | ENUM_ITEM_NAME - | END_ENVIRONMENT_NAME - ) - }) - .is_some() - { + while self.peek().map_or(false, |kind| { + !matches!( + kind, + Token::RCurly + | Token::RBrack + | Token::CommandName(CommandName::Section(_)) + | Token::CommandName(CommandName::EnumItem) + | Token::CommandName(CommandName::EndEnvironment) + ) + }) { self.content(ParserContext::default()); } - self.expect(R_BRACK); + + self.expect(Token::RBrack); self.builder.finish_node(); } @@ -302,14 +297,12 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); match self.peek() { - Some(WORD) => { + Some(Token::Word) => { self.key(); } - Some(_) | None => { - self.builder.token(MISSING.into(), ""); - } + Some(_) | None => {} } - self.expect(R_BRACK); + self.expect(Token::RBrack); self.builder.finish_node(); } @@ -317,29 +310,21 @@ impl<'a> Parser<'a> { self.builder.start_node(MIXED_GROUP.into()); self.eat(); self.trivia(); - while self - .peek() - .filter(|&kind| { - !matches!( - kind, - R_CURLY - | R_BRACK - | R_PAREN - | PART_NAME - | CHAPTER_NAME - | SECTION_NAME - | SUBSECTION_NAME - | PARAGRAPH_NAME - | SUBPARAGRAPH_NAME - | ENUM_ITEM_NAME - | END_ENVIRONMENT_NAME - ) - }) - .is_some() - { + while self.peek().map_or(false, |kind| { + !matches!( + kind, + Token::RCurly + | Token::RBrack + | Token::RParen + | Token::CommandName(CommandName::Section(_)) + | Token::CommandName(CommandName::EnumItem) + | Token::CommandName(CommandName::EndEnvironment) + ) + }) { self.content(ParserContext::default()); } - self.expect2(R_BRACK, R_PAREN); + + self.expect2(Token::RBrack, Token::RParen); self.builder.finish_node(); } @@ -348,7 +333,7 @@ impl<'a> Parser<'a> { self.eat(); while self .peek() - .filter(|&kind| matches!(kind, WHITESPACE | COMMENT | WORD)) + .filter(|&kind| matches!(kind, Token::Whitespace | Token::LineComment | Token::Word)) .is_some() { self.eat(); @@ -362,7 +347,7 @@ impl<'a> Parser<'a> { self.builder.start_node(VALUE.into()); while let Some(kind) = self.lexer.peek() { match kind { - COMMA | R_BRACK | R_CURLY => break, + Token::Comma | Token::RBrack | Token::RCurly => break, _ => self.content(ParserContext { allow_environment: true, allow_comma: false, @@ -375,7 +360,7 @@ impl<'a> Parser<'a> { fn key_value_pair(&mut self) { self.builder.start_node(KEY_VALUE_PAIR.into()); self.key(); - if self.peek() == Some(EQUALITY_SIGN) { + if self.peek() == Some(Token::Eq) { self.eat(); self.trivia(); if self @@ -383,14 +368,16 @@ impl<'a> Parser<'a> { .filter(|&kind| { !matches!( kind, - END_ENVIRONMENT_NAME | R_CURLY | R_BRACK | R_PAREN | COMMA + Token::CommandName(CommandName::EndEnvironment) + | Token::RCurly + | Token::RBrack + | Token::RParen + | Token::Comma ) }) .is_some() { self.value(); - } else { - self.builder.token(MISSING.into(), ""); } } @@ -401,10 +388,10 @@ impl<'a> Parser<'a> { self.builder.start_node(KEY_VALUE_BODY.into()); while let Some(kind) = self.peek() { match kind { - LINE_BREAK | WHITESPACE | COMMENT => self.eat(), - WORD => { + Token::LineBreak | Token::Whitespace | Token::LineComment => self.eat(), + Token::Word => { self.key_value_pair(); - if self.peek() == Some(COMMA) { + if self.peek() == Some(Token::Comma) { self.eat(); } else { break; @@ -416,7 +403,7 @@ impl<'a> Parser<'a> { self.builder.finish_node(); } - fn group_key_value(&mut self, node_kind: SyntaxKind, right_kind: SyntaxKind) { + fn group_key_value(&mut self, node_kind: SyntaxKind, right_kind: Token) { self.builder.start_node(node_kind.into()); self.eat(); self.trivia(); @@ -426,11 +413,11 @@ impl<'a> Parser<'a> { } fn curly_group_key_value(&mut self) { - self.group_key_value(CURLY_GROUP_KEY_VALUE, R_CURLY); + self.group_key_value(CURLY_GROUP_KEY_VALUE, Token::RCurly); } fn brack_group_key_value(&mut self) { - self.group_key_value(BRACK_GROUP_KEY_VALUE, R_BRACK); + self.group_key_value(BRACK_GROUP_KEY_VALUE, Token::RBrack); } fn formula(&mut self) { @@ -439,12 +426,17 @@ impl<'a> Parser<'a> { self.trivia(); while self .peek() - .filter(|&kind| !matches!(kind, R_CURLY | END_ENVIRONMENT_NAME | DOLLAR)) + .filter(|&kind| { + !matches!( + kind, + Token::RCurly | Token::CommandName(CommandName::EndEnvironment) | Token::Dollar + ) + }) .is_some() { self.content(ParserContext::default()); } - self.expect(DOLLAR); + self.expect(Token::Dollar); self.builder.finish_node(); } @@ -453,9 +445,9 @@ impl<'a> Parser<'a> { self.eat(); while let Some(kind) = self.peek() { match kind { - LINE_BREAK | WHITESPACE | COMMENT => self.eat(), - L_CURLY => self.curly_group(), - L_BRACK | L_PAREN => self.mixed_group(), + Token::LineBreak | Token::Whitespace | Token::LineComment => self.eat(), + Token::LCurly => self.curly_group(), + Token::LBrack | Token::LParen => self.mixed_group(), _ => break, } } @@ -467,12 +459,19 @@ impl<'a> Parser<'a> { self.eat(); while self .peek() - .filter(|&kind| !matches!(kind, END_ENVIRONMENT_NAME | R_CURLY | END_EQUATION_NAME)) + .filter(|&kind| { + !matches!( + kind, + Token::CommandName(CommandName::EndEnvironment) + | Token::RCurly + | Token::CommandName(CommandName::EndEquation) + ) + }) .is_some() { self.content(ParserContext::default()); } - self.expect(END_EQUATION_NAME); + self.expect(Token::CommandName(CommandName::EndEquation)); self.builder.finish_node(); } @@ -481,13 +480,11 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.peek() == Some(L_CURLY) { + if self.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } - if self.peek() == Some(L_BRACK) { + if self.peek() == Some(Token::LBrack) { self.brack_group(); } self.builder.finish_node(); @@ -498,10 +495,8 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.peek() == Some(L_CURLY) { + if self.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } self.builder.finish_node(); @@ -513,129 +508,29 @@ impl<'a> Parser<'a> { while self .peek() - .filter(|&kind| !matches!(kind, R_CURLY | END_ENVIRONMENT_NAME)) - .is_some() - { - self.content(ParserContext::default()); - } - - if self.peek() == Some(END_ENVIRONMENT_NAME) { - self.end(); - } else { - self.builder.token(MISSING.into(), ""); - } - self.builder.finish_node(); - } - - fn preamble(&mut self) { - self.builder.start_node(PREAMBLE.into()); - while self - .peek() - .filter(|&kind| kind != END_ENVIRONMENT_NAME) - .is_some() - { - self.content(ParserContext::default()); - } - self.builder.finish_node(); - } - - fn part(&mut self) { - self.builder.start_node(PART.into()); - self.eat(); - self.trivia(); - - if self.peek() == Some(L_CURLY) { - self.curly_group(); - } else { - self.builder.token(MISSING.into(), ""); - } - - while self - .peek() - .filter(|&kind| !matches!(kind, END_ENVIRONMENT_NAME | R_CURLY | PART_NAME)) - .is_some() - { - self.content(ParserContext::default()); - } - self.builder.finish_node(); - } - - fn chapter(&mut self) { - self.builder.start_node(CHAPTER.into()); - self.eat(); - self.trivia(); - - if self.peek() == Some(L_CURLY) { - self.curly_group(); - } else { - self.builder.token(MISSING.into(), ""); - } - - while self - .peek() .filter(|&kind| { !matches!( kind, - END_ENVIRONMENT_NAME | R_CURLY | PART_NAME | CHAPTER_NAME + Token::RCurly | Token::CommandName(CommandName::EndEnvironment) ) }) .is_some() { self.content(ParserContext::default()); } - self.builder.finish_node(); - } - fn section(&mut self) { - self.builder.start_node(SECTION.into()); - self.eat(); - self.trivia(); - - if self.peek() == Some(L_CURLY) { - self.curly_group(); - } else { - self.builder.token(MISSING.into(), ""); + if self.peek() == Some(Token::CommandName(CommandName::EndEnvironment)) { + self.end(); } - while self - .peek() - .filter(|&kind| { - !matches!( - kind, - END_ENVIRONMENT_NAME | R_CURLY | PART_NAME | CHAPTER_NAME | SECTION_NAME - ) - }) - .is_some() - { - self.content(ParserContext::default()); - } self.builder.finish_node(); } - fn subsection(&mut self) { - self.builder.start_node(SUBSECTION.into()); - self.eat(); - self.trivia(); - - if self.peek() == Some(L_CURLY) { - self.curly_group(); - } else { - self.builder.token(MISSING.into(), ""); - } - + fn preamble(&mut self) { + self.builder.start_node(PREAMBLE.into()); while self .peek() - .filter(|&kind| { - !matches!( - kind, - END_ENVIRONMENT_NAME - | R_CURLY - | PART_NAME - | CHAPTER_NAME - | SECTION_NAME - | SUBSECTION_NAME - ) - }) + .filter(|&kind| kind != Token::CommandName(CommandName::EndEnvironment)) .is_some() { self.content(ParserContext::default()); @@ -643,102 +538,34 @@ impl<'a> Parser<'a> { self.builder.finish_node(); } - fn subsubsection(&mut self) { - self.builder.start_node(SUBSUBSECTION.into()); - self.eat(); - self.trivia(); + fn section(&mut self, level: SectionLevel) { + let node_kind = match level { + SectionLevel::Part => PART, + SectionLevel::Chapter => CHAPTER, + SectionLevel::Section => SECTION, + SectionLevel::Subsection => SUBSECTION, + SectionLevel::Subsubsection => SUBSUBSECTION, + SectionLevel::Paragraph => PARAGRAPH, + SectionLevel::Subparagraph => SUBPARAGRAPH, + }; - if self.peek() == Some(L_CURLY) { - self.curly_group(); - } else { - self.builder.token(MISSING.into(), ""); - } - - while self - .peek() - .filter(|&kind| { - !matches!( - kind, - END_ENVIRONMENT_NAME - | R_CURLY - | PART_NAME - | CHAPTER_NAME - | SECTION_NAME - | SUBSECTION_NAME - | SUBSUBSECTION_NAME - ) - }) - .is_some() - { - self.content(ParserContext::default()); - } - self.builder.finish_node(); - } - - fn paragraph(&mut self) { - self.builder.start_node(PARAGRAPH.into()); + self.builder.start_node(node_kind.into()); self.eat(); self.trivia(); - if self.peek() == Some(L_CURLY) { + if self.peek() == Some(Token::LCurly) { self.curly_group(); - } else { - self.builder.token(MISSING.into(), ""); - } - - while self - .peek() - .filter(|&kind| { - !matches!( - kind, - END_ENVIRONMENT_NAME - | R_CURLY - | PART_NAME - | CHAPTER_NAME - | SECTION_NAME - | SUBSECTION_NAME - | SUBSUBSECTION_NAME - | PARAGRAPH_NAME - ) - }) - .is_some() - { - self.content(ParserContext::default()); } - self.builder.finish_node(); - } - fn subparagraph(&mut self) { - self.builder.start_node(SUBPARAGRAPH.into()); - self.eat(); - self.trivia(); - - if self.peek() == Some(L_CURLY) { - self.curly_group(); - } else { - self.builder.token(MISSING.into(), ""); + while let Some(kind) = self.peek() { + match kind { + Token::RCurly => break, + Token::CommandName(CommandName::EndEnvironment) => break, + Token::CommandName(CommandName::Section(nested)) if nested <= level => break, + _ => self.content(ParserContext::default()), + }; } - while self - .peek() - .filter(|&kind| { - !matches!( - kind, - END_ENVIRONMENT_NAME - | R_CURLY - | PART_NAME - | CHAPTER_NAME - | SECTION_NAME - | SUBSECTION_NAME - | SUBSUBSECTION_NAME - | PARAGRAPH_NAME - | SUBPARAGRAPH_NAME - ) - }) - .is_some() - { - self.content(ParserContext::default()); - } self.builder.finish_node(); } @@ -747,31 +574,20 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.peek() == Some(L_BRACK) { + if self.peek() == Some(Token::LBrack) { self.brack_group(); } - while self - .peek() - .filter(|&kind| { - !matches!( - kind, - END_ENVIRONMENT_NAME - | R_CURLY - | PART_NAME - | CHAPTER_NAME - | SECTION_NAME - | SUBSECTION_NAME - | SUBSUBSECTION_NAME - | PARAGRAPH_NAME - | SUBPARAGRAPH_NAME - | ENUM_ITEM_NAME - ) - }) - .is_some() - { - self.content(ParserContext::default()); + while let Some(kind) = self.peek() { + match kind { + Token::CommandName(CommandName::EndEnvironment) + | Token::RCurly + | Token::CommandName(CommandName::Section(_)) + | Token::CommandName(CommandName::EnumItem) => break, + _ => self.content(ParserContext::default()), + } } + self.builder.finish_node(); } @@ -779,14 +595,19 @@ impl<'a> Parser<'a> { self.builder.start_node(BLOCK_COMMENT.into()); self.eat(); - if self.peek() == Some(VERBATIM) { - self.eat(); - } - - if self.peek() == Some(END_BLOCK_COMMENT_NAME) { - self.eat(); - } else { - self.builder.token(MISSING.into(), ""); + while let Some(kind) = self.peek() { + match kind { + Token::CommandName(CommandName::BeginBlockComment) => { + self.block_comment(); + } + Token::CommandName(CommandName::EndBlockComment) => { + self.eat(); + break; + } + _ => { + self.eat(); + } + } } self.builder.finish_node(); @@ -797,14 +618,12 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.peek() == Some(L_BRACK) { + if self.peek() == Some(Token::LBrack) { self.brack_group(); } - if self.peek() == Some(L_CURLY) { + if self.peek() == Some(Token::LCurly) { self.curly_group(); - } else { - self.builder.token(MISSING.into(), ""); } self.builder.finish_node(); @@ -815,15 +634,13 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); for _ in 0..2 { - if self.lexer.peek() == Some(L_BRACK) { + if self.lexer.peek() == Some(Token::LBrack) { self.brack_group(); } } - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word_list(); - } else { - self.builder.token(MISSING.into(), ""); } self.builder.finish_node(); @@ -833,14 +650,12 @@ impl<'a> Parser<'a> { self.builder.start_node(kind.into()); self.eat(); self.trivia(); - if options && self.lexer.peek() == Some(L_BRACK) { + if options && self.lexer.peek() == Some(Token::LBrack) { self.brack_group_key_value(); } - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_path_list(); - } else { - self.builder.token(MISSING.into(), ""); } self.builder.finish_node(); @@ -853,15 +668,20 @@ impl<'a> Parser<'a> { while let Some(kind) = self.lexer.peek() { match kind { - COMMENT | WORD | EQUALITY_SIGN | COMMA | L_BRACK | R_BRACK - | GENERIC_COMMAND_NAME => self.path(), - L_CURLY => self.curly_group_path(), - WHITESPACE => self.eat(), + Token::LineComment + | Token::Word + | Token::Eq + | Token::Comma + | Token::LBrack + | Token::RBrack + | Token::CommandName(CommandName::Generic) => self.path(), + Token::LCurly => self.curly_group_path(), + Token::Whitespace => self.eat(), _ => break, }; } - self.expect(R_CURLY); + self.expect(Token::RCurly); self.builder.finish_node(); } @@ -872,16 +692,19 @@ impl<'a> Parser<'a> { while let Some(kind) = self.peek() { match kind { - COMMENT | WORD | EQUALITY_SIGN | L_BRACK | R_BRACK | GENERIC_COMMAND_NAME => { - self.path() - } - WHITESPACE | LINE_BREAK | COMMA => self.eat(), - L_CURLY => self.curly_group_path(), + Token::LineComment + | Token::Word + | Token::Eq + | Token::LBrack + | Token::RBrack + | Token::CommandName(CommandName::Generic) => self.path(), + Token::Whitespace | Token::LineBreak | Token::Comma => self.eat(), + Token::LCurly => self.curly_group_path(), _ => break, }; } - self.expect(R_CURLY); + self.expect(Token::RCurly); self.builder.finish_node(); } @@ -891,9 +714,14 @@ impl<'a> Parser<'a> { while let Some(kind) = self.peek() { match kind { - WHITESPACE | COMMENT | WORD | EQUALITY_SIGN | L_BRACK | R_BRACK - | GENERIC_COMMAND_NAME => self.eat(), - L_CURLY => self.curly_group_path(), + Token::Whitespace + | Token::LineComment + | Token::Word + | Token::Eq + | Token::LBrack + | Token::RBrack + | Token::CommandName(CommandName::Generic) => self.eat(), + Token::LCurly => self.curly_group_path(), _ => break, }; } @@ -943,10 +771,8 @@ impl<'a> Parser<'a> { self.trivia(); for _ in 0..2 { - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } } @@ -957,11 +783,10 @@ impl<'a> Parser<'a> { self.builder.start_node(LABEL_DEFINITION.into()); self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } + self.builder.finish_node(); } @@ -969,11 +794,10 @@ impl<'a> Parser<'a> { self.builder.start_node(LABEL_REFERENCE.into()); self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word_list(); - } else { - self.builder.token(MISSING.into(), ""); } + self.builder.finish_node(); } @@ -983,10 +807,8 @@ impl<'a> Parser<'a> { self.trivia(); for _ in 0..2 { - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } } @@ -997,15 +819,12 @@ impl<'a> Parser<'a> { self.builder.start_node(LABEL_NUMBER.into()); self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group(); - self.builder.token(MISSING.into(), ""); } self.builder.finish_node(); @@ -1016,24 +835,20 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_command(); - } else { - self.builder.token(MISSING.into(), ""); } - if self.lexer.peek() == Some(L_BRACK) { + if self.lexer.peek() == Some(Token::LBrack) { self.brack_group_word(); - if self.lexer.peek() == Some(L_BRACK) { + if self.lexer.peek() == Some(Token::LBrack) { self.brack_group(); } } - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_impl(); - } else { - self.builder.token(MISSING.into(), ""); } self.builder.finish_node(); @@ -1044,16 +859,12 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_command(); - } else { - self.builder.token(MISSING.into(), ""); } - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_impl(); - } else { - self.builder.token(MISSING.into(), ""); } self.builder.finish_node(); @@ -1064,16 +875,12 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_key_value(); - } else { - self.builder.token(MISSING.into(), ""); } self.builder.finish_node(); @@ -1084,14 +891,12 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_BRACK) { + if self.lexer.peek() == Some(Token::LBrack) { self.brack_group_key_value(); } - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } self.builder.finish_node(); @@ -1102,20 +907,20 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_BRACK) { + if self.lexer.peek() == Some(Token::LBrack) { self.brack_group_key_value(); } - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word(); } - if self.lexer.peek() == Some(L_BRACK) { + if self.lexer.peek() == Some(Token::LBrack) { self.brack_group(); } for _ in 0..2 { - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group(); } } @@ -1128,16 +933,12 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_key_value(); - } else { - self.builder.token(MISSING.into(), ""); } self.builder.finish_node(); @@ -1148,14 +949,12 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_BRACK) { + if self.lexer.peek() == Some(Token::LBrack) { self.brack_group_key_value(); } - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } self.builder.finish_node(); @@ -1166,23 +965,19 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } - if self.lexer.peek() == Some(L_BRACK) { + if self.lexer.peek() == Some(Token::LBrack) { self.brack_group_word(); } - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group(); - } else { - self.builder.token(MISSING.into(), ""); } - if self.lexer.peek() == Some(L_BRACK) { + if self.lexer.peek() == Some(Token::LBrack) { self.brack_group_word(); } @@ -1194,10 +989,8 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } self.builder.finish_node(); @@ -1208,22 +1001,16 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group(); - } else { - self.builder.token(MISSING.into(), ""); } self.builder.finish_node(); @@ -1234,21 +1021,17 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_BRACK) { + if self.lexer.peek() == Some(Token::LBrack) { self.brack_group_word(); } - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word_list(); - } else { - self.builder.token(MISSING.into(), ""); } for _ in 0..3 { - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } } @@ -1260,10 +1043,8 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word_list(); - } else { - self.builder.token(MISSING.into(), ""); } self.builder.finish_node(); @@ -1274,24 +1055,20 @@ impl<'a> Parser<'a> { self.eat(); self.trivia(); - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_word(); - } else { - self.builder.token(MISSING.into(), ""); } - if self.lexer.peek() == Some(L_BRACK) { + if self.lexer.peek() == Some(Token::LBrack) { self.brack_group_word(); - if self.lexer.peek() == Some(L_BRACK) { + if self.lexer.peek() == Some(Token::LBrack) { self.brack_group(); } } for _ in 0..2 { - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.curly_group_without_environments(); - } else { - self.builder.token(MISSING.into(), ""); } } @@ -1304,25 +1081,31 @@ impl<'a> Parser<'a> { self.trivia(); let checkpoint = self.builder.checkpoint(); - if self.lexer.peek() == Some(L_CURLY) { + if self.lexer.peek() == Some(Token::LCurly) { self.eat(); self.trivia(); if matches!( self.lexer.peek(), - Some(WORD | EQUALITY_SIGN | L_BRACK | R_BRACK | GENERIC_COMMAND_NAME) + Some( + Token::Word + | Token::Eq + | Token::LBrack + | Token::RBrack + | Token::CommandName(CommandName::Generic) + ) ) { self.builder .start_node_at(checkpoint, CURLY_GROUP_WORD.into()); self.path(); } else { self.builder.start_node_at(checkpoint, CURLY_GROUP.into()); - while matches!(self.lexer.peek(), Some(L_CURLY)) { + while matches!(self.lexer.peek(), Some(Token::LCurly)) { self.curly_group_path(); } } - self.expect(R_CURLY); + self.expect(Token::RCurly); self.builder.finish_node(); } diff --git a/support/texlab/src/parser/latex/lexer.rs b/support/texlab/src/parser/latex/lexer.rs index 9b0a6726eb..ee5b8dd328 100644 --- a/support/texlab/src/parser/latex/lexer.rs +++ b/support/texlab/src/parser/latex/lexer.rs @@ -1,641 +1,65 @@ +mod commands; +pub(super) mod types; + use logos::Logos; use crate::syntax::latex::SyntaxKind; -#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash, PartialOrd, Ord, Logos)] -#[repr(u16)] -enum RootToken { - #[regex(r"[\r\n]+", priority = 2)] - LineBreak = 2, - - #[regex(r"\s+", priority = 1)] - Whitespace, - - #[regex(r"%[^\r\n]*")] - LineComment, - - #[token("{")] - LCurly, - - #[token("}")] - RCurly, - - #[token("[")] - LBrack, - - #[token("]")] - RBrack, - - #[token("(")] - LParen, - - #[token(")")] - RParen, - - #[token(",")] - Comma, - - #[token("=")] - Eq, - - #[regex(r"[^\s\\%\{\},\$\[\]\(\)=]+")] - #[error] - Word, - - #[regex(r"\$\$?")] - Dollar, - - #[regex(r"\\([^\r\n]|[@a-zA-Z:_]+\*?)?")] - CommandName, - - #[token("\\iffalse")] - BeginBlockComment, - - #[token("\\begin{asy}")] - #[token("\\begin{verbatim}")] - #[token("\\begin{lstlisting}")] - #[token("\\begin{minted}")] - #[token("\\begin{pycode}")] - BeginVerbatimEnvironment, -} - -#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash, PartialOrd, Ord, Logos)] -enum CommandNameToken { - #[token("\\begin")] - BeginEnvironment, - - #[token("\\end")] - EndEnvironment, - - #[token("\\[")] - BeginEquation, - - #[token("\\]")] - EndEquation, - - #[token("\\part")] - #[token("\\part*")] - Part, - - #[token("\\chapter")] - #[token("\\chapter*")] - Chapter, - - #[token("\\section")] - #[token("\\section*")] - Section, - - #[token("\\subsection")] - #[token("\\subsection*")] - Subsection, - - #[token("\\subsubsection")] - #[token("\\subsubsection*")] - Subsubsection, - - #[token("\\paragraph")] - #[token("\\paragraph*")] - Paragraph, - - #[token("\\subparagraph")] - #[token("\\subparagraph*")] - Subparagraph, - - #[token("\\item")] - EnumItem, - - #[token("\\caption")] - Caption, - - #[token("\\cite")] - #[token("\\cite*")] - #[token("\\Cite")] - #[token("\\nocite")] - #[token("\\citet")] - #[token("\\citet*")] - #[token("\\citep")] - #[token("\\citep*")] - #[token("\\citeauthor")] - #[token("\\citeauthor*")] - #[token("\\Citeauthor")] - #[token("\\Citeauthor*")] - #[token("\\citetitle")] - #[token("\\citetitle*")] - #[token("\\citeyear")] - #[token("\\citeyear*")] - #[token("\\citedate")] - #[token("\\citedate*")] - #[token("\\citeurl")] - #[token("\\fullcite")] - #[token("\\citeyearpar")] - #[token("\\citealt")] - #[token("\\citealp")] - #[token("\\citetext")] - #[token("\\parencite")] - #[token("\\parencite*")] - #[token("\\Parencite")] - #[token("\\footcite")] - #[token("\\footfullcite")] - #[token("\\footcitetext")] - #[token("\\textcite")] - #[token("\\Textcite")] - #[token("\\smartcite")] - #[token("\\supercite")] - #[token("\\autocite")] - #[token("\\autocite*")] - #[token("\\Autocite")] - #[token("\\Autocite*")] - #[token("\\volcite")] - #[token("\\Volcite")] - #[token("\\pvolcite")] - #[token("\\Pvolcite")] - #[token("\\fvolcite")] - #[token("\\ftvolcite")] - #[token("\\svolcite")] - #[token("\\Svolcite")] - #[token("\\tvolcite")] - #[token("\\Tvolcite")] - #[token("\\avolcite")] - #[token("\\Avolcite")] - #[token("\\notecite")] - #[token("\\pnotecite")] - #[token("\\Pnotecite")] - #[token("\\fnotecite")] - #[token("\\citeA")] - #[token("\\citeA*")] - Citation, - - #[token("\\usepackage")] - #[token("\\RequirePackage")] - PackageInclude, - - #[token("\\documentclass")] - ClassInclude, - - #[token("\\include")] - #[token("\\subfileinclude")] - #[token("\\input")] - #[token("\\subfile")] - LatexInclude, - - #[token("\\addbibresource")] - BiblatexInclude, - - #[token("\\bibliography")] - BibtexInclude, - - #[token("\\includegraphics")] - GraphicsInclude, - - #[token("\\includesvg")] - SvgInclude, - - #[token("\\includeinkscape")] - InkscapeInclude, - - #[token("\\verbatiminput")] - #[token("\\VerbatimInput")] - VerbatimInclude, - - #[token("\\import")] - #[token("\\subimport")] - #[token("\\inputfrom")] - #[token("\\subinputfrom")] - #[token("\\includefrom")] - #[token("\\subincludefrom")] - Import, - - #[token("\\label")] - LabelDefinition, - - #[token("\\ref")] - #[token("\\vref")] - #[token("\\Vref")] - #[token("\\autoref")] - #[token("\\pageref")] - #[token("\\cref")] - #[token("\\cref*")] - #[token("\\Cref")] - #[token("\\Cref*")] - #[token("\\namecref")] - #[token("\\nameCref")] - #[token("\\lcnamecref")] - #[token("\\namecrefs")] - #[token("\\nameCrefs")] - #[token("\\lcnamecrefs")] - #[token("\\labelcref")] - #[token("\\labelcpageref")] - #[token("\\eqref")] - LabelReference, - - #[token("\\crefrange")] - #[token("\\crefrange*")] - #[token("\\Crefrange")] - #[token("\\Crefrange*")] - LabelReferenceRange, - - #[token("\\newlabel")] - LabelNumber, - - #[token("\\newcommand")] - #[token("\\newcommand*")] - #[token("\\renewcommand")] - #[token("\\renewcommand*")] - #[token("\\DeclareRobustCommand")] - #[token("\\DeclareRobustCommand*")] - CommandDefinition, - - #[token("\\DeclareMathOperator")] - #[token("\\DeclareMathOperator*")] - MathOperator, - - #[token("\\newglossaryentry")] - GlossaryEntryDefinition, - - #[token("\\gls")] - #[token("\\Gls")] - #[token("\\GLS")] - #[token("\\glspl")] - #[token("\\Glspl")] - #[token("\\GLSpl")] - #[token("\\glsdisp")] - #[token("\\glslink")] - #[token("\\glstext")] - #[token("\\Glstext")] - #[token("\\GLStext")] - #[token("\\glsfirst")] - #[token("\\Glsfirst")] - #[token("\\GLSfirst")] - #[token("\\glsplural")] - #[token("\\Glsplural")] - #[token("\\GLSplural")] - #[token("\\glsfirstplural")] - #[token("\\Glsfirstplural")] - #[token("\\GLSfirstplural")] - #[token("\\glsname")] - #[token("\\Glsname")] - #[token("\\GLSname")] - #[token("\\glssymbol")] - #[token("\\Glssymbol")] - #[token("\\glsdesc")] - #[token("\\Glsdesc")] - #[token("\\GLSdesc")] - #[token("\\glsuseri")] - #[token("\\Glsuseri")] - #[token("\\GLSuseri")] - #[token("\\glsuserii")] - #[token("\\Glsuserii")] - #[token("\\glsuseriii")] - #[token("\\glsuseriv")] - #[token("\\Glsuseriv")] - #[token("\\GLSuseriv")] - #[token("\\glsuserv")] - #[token("\\Glsuserv")] - #[token("\\GLSuserv")] - #[token("\\glsuservi")] - #[token("\\Glsuservi")] - #[token("\\GLSuservi")] - GlossaryEntryReference, - - #[token("\\newacronym")] - #[token("\\newacro")] - #[token("\\acrodef")] - #[token("\\acro")] - #[token("\\newacroindefinite")] - #[token("\\acrodefindefinite")] - #[token("\\acroindefinite")] - #[token("\\acroplural")] - #[token("\\newacroplural")] - #[token("\\acrodefplural")] - AcronymDefinition, - - #[token("\\DeclareAcronym")] - AcronymDeclaration, - - #[token("\\acrshort")] - #[token("\\Acrshort")] - #[token("\\ACRshort")] - #[token("\\acrshortpl")] - #[token("\\Acrshortpl")] - #[token("\\ACRshortpl")] - #[token("\\acrlong")] - #[token("\\Acrlong")] - #[token("\\ACRlong")] - #[token("\\acrlongpl")] - #[token("\\Acrlongpl")] - #[token("\\ACRlongpl")] - #[token("\\acrfull")] - #[token("\\Acrfull")] - #[token("\\ACRfull")] - #[token("\\acrfullpl")] - #[token("\\Acrfullpl")] - #[token("\\ACRfullpl")] - #[token("\\acs")] - #[token("\\Acs")] - #[token("\\acsp")] - #[token("\\Acsp")] - #[token("\\acl")] - #[token("\\Acl")] - #[token("\\aclp")] - #[token("\\Aclp")] - #[token("\\acf")] - #[token("\\Acf")] - #[token("\\acfi")] - #[token("\\Acfi")] - #[token("\\acfp")] - #[token("\\Acfp")] - #[token("\\ac")] - #[token("\\Ac")] - #[token("\\acp")] - #[token("\\Acp")] - #[token("\\acused")] - #[token("\\acsu")] - #[token("\\Aclu")] - #[token("\\iac")] - #[token("\\Iac")] - #[token("\\acs*")] - #[token("\\Acs*")] - #[token("\\acsp*")] - #[token("\\Acsp*")] - #[token("\\acl*")] - #[token("\\Acl*")] - #[token("\\aclp*")] - #[token("\\Aclp*")] - #[token("\\acf*")] - #[token("\\Acf*")] - #[token("\\acfi*")] - #[token("\\Acfi*")] - #[token("\\acfp*")] - #[token("\\Acfp*")] - #[token("\\ac*")] - #[token("\\Ac*")] - #[token("\\acp*")] - #[token("\\Acp*")] - #[token("\\acused*")] - #[token("\\acsu*")] - #[token("\\Aclu*")] - #[token("\\iac*")] - #[token("\\Iac*")] - #[token("\\glsentrylong")] - #[token("\\Glsentrylong")] - #[token("\\glsentrylongpl")] - #[token("\\Glsentrylongpl")] - #[token("\\glsentryshort")] - #[token("\\Glsentryshort")] - #[token("\\glsentryshortpl")] - #[token("\\Glsentryshortpl")] - #[token("\\glsentryfullpl")] - #[token("\\Glsentryfullpl")] - AcronymReference, - - #[token("\\newtheorem")] - #[token("\\newtheorem*")] - #[token("\\declaretheorem")] - #[token("\\declaretheorem*")] - TheoremDefinition, - - #[token("\\color")] - #[token("\\colorbox")] - #[token("\\textcolor")] - #[token("\\pagecolor")] - ColorReference, - - #[token("\\definecolor")] - ColorDefinition, - - #[token("\\definecolorset")] - ColorSetDefinition, - - #[token("\\usepgflibrary")] - #[token("\\usetikzlibrary")] - TikzLibraryImport, - - #[token("\\newenvironment")] - #[token("\\newenvironment*")] - #[token("\\renewenvironment")] - #[token("\\renewenvironment*")] - EnvironmentDefinition, - - #[token("\\graphicspath")] - GraphicsPath, - - #[token("\\fi")] - EndBlockComment, - - #[regex(r"\\([^\r\n]|[@a-zA-Z:_]+\*?)?")] - #[error] - Generic, -} - -#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash, PartialOrd, Ord, Logos)] -enum BlockCommentToken { - #[token("\\fi")] - End, - - #[regex(r"\\([^\r\n]|[@a-zA-Z:_]+\*?)?")] - #[regex(r"[^\\]+")] - #[error] - Verbatim, -} - -#[derive(Debug, PartialEq, Eq, Clone, Copy, Hash, PartialOrd, Ord, Logos)] -enum VerbatimEnvironmentToken { - #[token("\\end{asy}")] - #[token("\\end{verbatim}")] - #[token("\\end{lstlisting}")] - #[token("\\end{minted}")] - #[token("\\end{pycode}")] - End, - - #[regex(r"\\([^\r\n]|[@a-zA-Z:_]+\*?)?")] - #[regex(r"[^\\]+")] - #[error] - Verbatim, -} +use self::types::{CommandName, Token}; #[derive(Debug, PartialEq, Eq, Clone)] pub struct Lexer<'a> { - tokens: Vec<(SyntaxKind, &'a str)>, + tokens: Vec<(Token, &'a str)>, } impl<'a> Lexer<'a> { pub fn new(input: &'a str) -> Self { - let mut tokens = Vec::new(); - tokenize(input, &mut tokens); + let mut tokens = tokenize(input); tokens.reverse(); Self { tokens } } - pub fn peek(&self) -> Option<SyntaxKind> { + pub fn peek(&self) -> Option<Token> { self.tokens.last().map(|(kind, _)| *kind) } pub fn eat(&mut self) -> Option<(SyntaxKind, &'a str)> { - self.tokens.pop() - } -} - -fn tokenize<'a>(input: &'a str, tokens: &mut Vec<(SyntaxKind, &'a str)>) { - let mut lexer = RootToken::lexer(input); - while let Some(kind) = lexer.next() { - let text = lexer.slice(); - match kind { - RootToken::LineBreak => { - tokens.push((SyntaxKind::LINE_BREAK, text)); - } - RootToken::Whitespace => { - tokens.push((SyntaxKind::WHITESPACE, text)); - } - RootToken::LineComment => { - tokens.push((SyntaxKind::COMMENT, text)); - } - RootToken::LCurly => { - tokens.push((SyntaxKind::L_CURLY, text)); - } - RootToken::RCurly => { - tokens.push((SyntaxKind::R_CURLY, text)); - } - RootToken::LBrack => { - tokens.push((SyntaxKind::L_BRACK, text)); - } - RootToken::RBrack => { - tokens.push((SyntaxKind::R_BRACK, text)); - } - RootToken::LParen => { - tokens.push((SyntaxKind::L_PAREN, text)); - } - RootToken::RParen => { - tokens.push((SyntaxKind::R_PAREN, text)); - } - RootToken::Comma => { - tokens.push((SyntaxKind::COMMA, text)); - } - RootToken::Eq => { - tokens.push((SyntaxKind::EQUALITY_SIGN, text)); - } - RootToken::Word => { - tokens.push((SyntaxKind::WORD, text)); - } - RootToken::Dollar => { - tokens.push((SyntaxKind::DOLLAR, text)); - } - RootToken::CommandName => { - let kind = tokenize_command_name(text); - tokens.push((kind, text)); - } - RootToken::BeginBlockComment => { - tokens.push((SyntaxKind::BEGIN_BLOCK_COMMENT_NAME, text)); - let end = lexer.span().end; - lexer = RootToken::lexer(tokenize_block_comment(&lexer.source()[end..], tokens)); - } - RootToken::BeginVerbatimEnvironment => { - tokens.push((SyntaxKind::BEGIN_ENVIRONMENT_NAME, "\\begin")); - tokens.push((SyntaxKind::L_CURLY, "{")); - tokens.push((SyntaxKind::WORD, &text["\\begin{".len()..text.len() - 1])); - tokens.push((SyntaxKind::R_CURLY, "}")); - let end = lexer.span().end; - lexer = RootToken::lexer(tokenize_verbatim_environment( - &lexer.source()[end..], - tokens, - )); - } - } - } -} - -fn tokenize_command_name(text: &str) -> SyntaxKind { - let mut lexer = CommandNameToken::lexer(text); - match lexer.next().unwrap() { - CommandNameToken::BeginEnvironment => SyntaxKind::BEGIN_ENVIRONMENT_NAME, - CommandNameToken::EndEnvironment => SyntaxKind::END_ENVIRONMENT_NAME, - CommandNameToken::BeginEquation => SyntaxKind::BEGIN_EQUATION_NAME, - CommandNameToken::EndEquation => SyntaxKind::END_EQUATION_NAME, - CommandNameToken::Part => SyntaxKind::PART_NAME, - CommandNameToken::Chapter => SyntaxKind::CHAPTER_NAME, - CommandNameToken::Section => SyntaxKind::SECTION_NAME, - CommandNameToken::Subsection => SyntaxKind::SUBSECTION_NAME, - CommandNameToken::Subsubsection => SyntaxKind::SUBSUBSECTION_NAME, - CommandNameToken::Paragraph => SyntaxKind::PARAGRAPH_NAME, - CommandNameToken::Subparagraph => SyntaxKind::SUBPARAGRAPH_NAME, - CommandNameToken::EnumItem => SyntaxKind::ENUM_ITEM_NAME, - CommandNameToken::Caption => SyntaxKind::CAPTION_NAME, - CommandNameToken::Citation => SyntaxKind::CITATION_NAME, - CommandNameToken::PackageInclude => SyntaxKind::PACKAGE_INCLUDE_NAME, - CommandNameToken::ClassInclude => SyntaxKind::CLASS_INCLUDE_NAME, - CommandNameToken::LatexInclude => SyntaxKind::LATEX_INCLUDE_NAME, - CommandNameToken::BiblatexInclude => SyntaxKind::BIBLATEX_INCLUDE_NAME, - CommandNameToken::BibtexInclude => SyntaxKind::BIBTEX_INCLUDE_NAME, - CommandNameToken::GraphicsInclude => SyntaxKind::GRAPHICS_INCLUDE_NAME, - CommandNameToken::SvgInclude => SyntaxKind::SVG_INCLUDE_NAME, - CommandNameToken::InkscapeInclude => SyntaxKind::INKSCAPE_INCLUDE_NAME, - CommandNameToken::VerbatimInclude => SyntaxKind::VERBATIM_INCLUDE_NAME, - CommandNameToken::Import => SyntaxKind::IMPORT_NAME, - CommandNameToken::LabelDefinition => SyntaxKind::LABEL_DEFINITION_NAME, - CommandNameToken::LabelReference => SyntaxKind::LABEL_REFERENCE_NAME, - CommandNameToken::LabelReferenceRange => SyntaxKind::LABEL_REFERENCE_RANGE_NAME, - CommandNameToken::LabelNumber => SyntaxKind::LABEL_NUMBER_NAME, - CommandNameToken::CommandDefinition => SyntaxKind::COMMAND_DEFINITION_NAME, - CommandNameToken::MathOperator => SyntaxKind::MATH_OPERATOR_NAME, - CommandNameToken::GlossaryEntryDefinition => SyntaxKind::GLOSSARY_ENTRY_DEFINITION_NAME, - CommandNameToken::GlossaryEntryReference => SyntaxKind::GLOSSARY_ENTRY_REFERENCE_NAME, - CommandNameToken::AcronymDefinition => SyntaxKind::ACRONYM_DEFINITION_NAME, - CommandNameToken::AcronymDeclaration => SyntaxKind::ACRONYM_DECLARATION_NAME, - CommandNameToken::AcronymReference => SyntaxKind::ACRONYM_REFERENCE_NAME, - CommandNameToken::TheoremDefinition => SyntaxKind::THEOREM_DEFINITION_NAME, - CommandNameToken::ColorReference => SyntaxKind::COLOR_REFERENCE_NAME, - CommandNameToken::ColorDefinition => SyntaxKind::COLOR_DEFINITION_NAME, - CommandNameToken::ColorSetDefinition => SyntaxKind::COLOR_SET_DEFINITION_NAME, - CommandNameToken::TikzLibraryImport => SyntaxKind::TIKZ_LIBRARY_IMPORT_NAME, - CommandNameToken::EnvironmentDefinition => SyntaxKind::ENVIRONMENT_DEFINITION_NAME, - CommandNameToken::EndBlockComment => SyntaxKind::END_BLOCK_COMMENT_NAME, - CommandNameToken::GraphicsPath => SyntaxKind::GRAPHICS_PATH_NAME, - CommandNameToken::Generic => SyntaxKind::GENERIC_COMMAND_NAME, - } -} - -fn tokenize_block_comment<'a>(input: &'a str, tokens: &mut Vec<(SyntaxKind, &'a str)>) -> &'a str { - let mut lexer = BlockCommentToken::lexer(input); - let mut end = 0; - while let Some(kind) = lexer.next() { - match kind { - BlockCommentToken::Verbatim => { - end = lexer.span().end; - } - BlockCommentToken::End => { - end = lexer.span().start; - break; - } + let (kind, text) = self.tokens.pop()?; + let kind = match kind { + Token::LineBreak => SyntaxKind::LINE_BREAK, + Token::Whitespace => SyntaxKind::WHITESPACE, + Token::LineComment => SyntaxKind::COMMENT, + Token::LCurly => SyntaxKind::L_CURLY, + Token::RCurly => SyntaxKind::R_CURLY, + Token::LBrack => SyntaxKind::L_BRACK, + Token::RBrack => SyntaxKind::R_BRACK, + Token::LParen => SyntaxKind::L_PAREN, + Token::RParen => SyntaxKind::R_PAREN, + Token::Comma => SyntaxKind::COMMA, + Token::Eq => SyntaxKind::EQUALITY_SIGN, + Token::Word => SyntaxKind::WORD, + Token::Dollar => SyntaxKind::DOLLAR, + Token::CommandName(_) => SyntaxKind::COMMAND_NAME, }; - } - if end > 0 { - tokens.push((SyntaxKind::VERBATIM, &input[..end])); + Some((kind, text)) } - - &input[end..] } -fn tokenize_verbatim_environment<'a>( - input: &'a str, - tokens: &mut Vec<(SyntaxKind, &'a str)>, -) -> &'a str { - let mut lexer = VerbatimEnvironmentToken::lexer(input); - let mut end = 0; - while let Some(kind) = lexer.next() { - match kind { - VerbatimEnvironmentToken::Verbatim => { - end = lexer.span().end; - } - VerbatimEnvironmentToken::End => { - end = lexer.span().start; - break; - } - }; - } - - if end > 0 { - tokens.push((SyntaxKind::VERBATIM, &input[..end])); - } - - &input[end..] +fn tokenize(input: &str) -> Vec<(Token, &str)> { + let mut lexer = Token::lexer(input); + std::iter::from_fn(move || { + let kind = lexer.next()?; + let text = lexer.slice(); + Some((kind, text)) + }) + .map(|(kind, text)| { + if kind == Token::CommandName(CommandName::Generic) { + let name = commands::classify(&text[1..]); + (Token::CommandName(name), text) + } else { + (kind, text) + } + }) + .collect() } diff --git a/support/texlab/src/parser/latex/lexer/commands.rs b/support/texlab/src/parser/latex/lexer/commands.rs new file mode 100644 index 0000000000..ba609f5d7f --- /dev/null +++ b/support/texlab/src/parser/latex/lexer/commands.rs @@ -0,0 +1,93 @@ +use super::types::{CommandName, SectionLevel}; + +pub fn classify(name: &str) -> CommandName { + match name { + "begin" => CommandName::BeginEnvironment, + "end" => CommandName::EndEnvironment, + "[" => CommandName::BeginEquation, + "]" => CommandName::EndEquation, + "part" | "part*" => CommandName::Section(SectionLevel::Part), + "chapter" | "chapter*" => CommandName::Section(SectionLevel::Chapter), + "section" | "section*" => CommandName::Section(SectionLevel::Section), + "subsection" | "subsection*" => CommandName::Section(SectionLevel::Subsection), + "subsubsection" | "subsubsection*" => CommandName::Section(SectionLevel::Subsubsection), + "paragraph" | "paragraph*" => CommandName::Section(SectionLevel::Paragraph), + "subparagraph" | "subparagraph*" => CommandName::Section(SectionLevel::Subparagraph), + "item" => CommandName::EnumItem, + "caption" => CommandName::Caption, + "cite" | "cite*" | "Cite" | "nocite" | "citet" | "citet*" | "citep" | "citep*" + | "citeauthor" | "citeauthor*" | "Citeauthor" | "Citeauthor*" | "citetitle" + | "citetitle*" | "citeyear" | "citeyear*" | "citedate" | "citedate*" | "citeurl" + | "fullcite" | "citeyearpar" | "citealt" | "citealp" | "citetext" | "parencite" + | "parencite*" | "Parencite" | "footcite" | "footfullcite" | "footcitetext" + | "textcite" | "Textcite" | "smartcite" | "supercite" | "autocite" | "autocite*" + | "Autocite" | "Autocite*" | "volcite" | "Volcite" | "pvolcite" | "Pvolcite" + | "fvolcite" | "ftvolcite" | "svolcite" | "Svolcite" | "tvolcite" | "Tvolcite" + | "avolcite" | "Avolcite" | "notecite" | "pnotecite" | "Pnotecite" | "fnotecite" + | "citeA" | "citeA*" => CommandName::Citation, + "usepackage" | "RequirePackage" => CommandName::PackageInclude, + "documentclass" => CommandName::ClassInclude, + "include" | "subfileinclude" | "input" | "subfile" => CommandName::LatexInclude, + "addbibresource" => CommandName::BiblatexInclude, + "bibliography" => CommandName::BibtexInclude, + "includegraphics" => CommandName::GraphicsInclude, + "includesvg" => CommandName::SvgInclude, + "includeinkscape" => CommandName::InkscapeInclude, + "verbatiminput" | "VerbatimInput" => CommandName::VerbatimInclude, + "import" | "subimport" | "inputfrom" | "subinputfrom" | "subincludefrom" => { + CommandName::Import + } + "label" => CommandName::LabelDefinition, + "ref" | "vref" | "Vref" | "autoref" | "pageref" | "cref" | "cref*" | "Cref" | "Cref*" + | "namecref" | "nameCref" | "lcnamecref" | "namecrefs" | "nameCrefs" | "lcnamecrefs" + | "labelcref" | "labelcpageref" | "eqref" => CommandName::LabelReference, + "crefrange" | "crefrange*" | "Crefrange" | "Crefrange*" => CommandName::LabelReferenceRange, + "newlabel" => CommandName::LabelNumber, + "newcommand" + | "newcommand*" + | "renewcommand" + | "renewcommand*" + | "DeclareRobustCommand" + | "DeclareRobustCommand*" => CommandName::CommandDefinition, + "DeclareMathOperator" | "DeclareMathOperator*" => CommandName::MathOperator, + "newglossaryentry" => CommandName::GlossaryEntryDefinition, + "gls" | "Gls" | "GLS" | "glspl" | "Glspl" | "GLSpl" | "glsdisp" | "glslink" | "glstext" + | "Glstext" | "GLStext" | "glsfirst" | "Glsfirst" | "GLSfirst" | "glsplural" + | "Glsplural" | "GLSplural" | "glsfirstplural" | "Glsfirstplural" | "GLSfirstplural" + | "glsname" | "Glsname" | "GLSname" | "glssymbol" | "Glssymbol" | "glsdesc" | "Glsdesc" + | "GLSdesc" | "glsuseri" | "Glsuseri" | "GLSuseri" | "glsuserii" | "Glsuserii" + | "glsuseriii" | "glsuseriv" | "Glsuseriv" | "GLSuseriv" | "glsuserv" | "Glsuserv" + | "GLSuserv" | "glsuservi" | "Glsuservi" | "GLSuservi" => { + CommandName::GlossaryEntryReference + } + "newacronym" | "newacro" | "acrodef" | "acro" | "newacroindefinite" + | "acrodefindefinite" | "acroindefinite" | "acroplural" | "newacroplural" + | "acrodefplural" => CommandName::AcronymDefinition, + "DeclareAcronym" => CommandName::AcronymDeclaration, + "acrshort" | "Acrshort" | "ACRshort" | "acrshortpl" | "Acrshortpl" | "ACRshortpl" + | "acrlong" | "Acrlong" | "ACRlong" | "acrlongpl" | "Acrlongpl" | "ACRlongpl" + | "acrfull" | "Acrfull" | "ACRfull" | "acrfullpl" | "Acrfullpl" | "ACRfullpl" | "acs" + | "Acs" | "acsp" | "Acsp" | "acl" | "Acl" | "aclp" | "Aclp" | "acf" | "Acf" | "acfi" + | "Acfi" | "acfp" | "Acfp" | "ac" | "Ac" | "acp" | "Acp" | "acused" | "acsu" | "Aclu" + | "iac" | "Iac" | "acs*" | "Acs*" | "acsp*" | "Acsp*" | "acl*" | "Acl*" | "aclp*" + | "Aclp*" | "acf*" | "Acf*" | "acfi*" | "Acfi*" | "acfp*" | "Acfp*" | "ac*" | "Ac*" + | "acp*" | "Acp*" | "acused*" | "acsu*" | "Aclu*" | "iac*" | "Iac*" | "glsentrylong" + | "Glsentrylong" | "glsentrylongpl" | "Glsentrylongpl" | "glsentryshort" + | "Glsentryshort" | "glsentryshortpl" | "Glsentryshortpl" | "glsentryfullpl" + | "Glsentryfullpl" => CommandName::AcronymReference, + "newtheorem" | "newtheorem*" | "declaretheorem" | "declaretheorem*" => { + CommandName::TheoremDefinition + } + "color" | "colorbox" | "textcolor" | "pagecolor" => CommandName::ColorReference, + "definecolor" => CommandName::ColorDefinition, + "definecolorset" => CommandName::ColorSetDefinition, + "usepgflibrary" | "usetikzlibrary" => CommandName::TikzLibraryImport, + "newenvironment" | "newenvironment*" | "renewenvironment" | "renewenvironment*" => { + CommandName::EnvironmentDefinition + } + "graphicspath" => CommandName::GraphicsPath, + "iffalse" => CommandName::BeginBlockComment, + "fi" => CommandName::EndBlockComment, + _ => CommandName::Generic, + } +} diff --git a/support/texlab/src/parser/latex/lexer/types.rs b/support/texlab/src/parser/latex/lexer/types.rs new file mode 100644 index 0000000000..4355c021c1 --- /dev/null +++ b/support/texlab/src/parser/latex/lexer/types.rs @@ -0,0 +1,132 @@ +use logos::Logos; + +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash, Logos)] +pub enum Token { + #[regex(r"[\r\n]+", priority = 2)] + LineBreak, + + #[regex(r"[^\S\r\n]+", priority = 1)] + Whitespace, + + #[regex(r"%[^\r\n]*")] + LineComment, + + #[token("{")] + LCurly, + + #[token("}")] + RCurly, + + #[token("[")] + LBrack, + + #[token("]")] + RBrack, + + #[token("(")] + LParen, + + #[token(")")] + RParen, + + #[token(",")] + Comma, + + #[token("=")] + Eq, + + #[regex(r"[^\s\\%\{\},\$\[\]\(\)=]+")] + #[error] + Word, + + #[regex(r"\$\$?")] + Dollar, + + #[regex(r"\\", lex_command_name)] + CommandName(CommandName), +} + +fn lex_command_name(lexer: &mut logos::Lexer<Token>) -> CommandName { + let input = &lexer.source()[lexer.span().end..]; + + let mut chars = input.chars(); + let Some(c) = chars.next() else { return CommandName::Generic }; + lexer.bump(c.len_utf8()); + if !c.is_alphanumeric() && c != '@' { + return CommandName::Generic; + } + + while let Some(c) = chars.next() { + match c { + '*' => { + lexer.bump(c.len_utf8()); + break; + } + c if c.is_alphanumeric() => { + lexer.bump(c.len_utf8()); + } + '@' | ':' | '_' => { + lexer.bump(c.len_utf8()); + } + _ => { + break; + } + }; + } + + CommandName::Generic +} + +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)] +pub enum CommandName { + Generic, + BeginEnvironment, + EndEnvironment, + BeginEquation, + EndEquation, + Section(SectionLevel), + EnumItem, + Caption, + Citation, + PackageInclude, + ClassInclude, + LatexInclude, + BiblatexInclude, + BibtexInclude, + GraphicsInclude, + SvgInclude, + InkscapeInclude, + VerbatimInclude, + Import, + LabelDefinition, + LabelReference, + LabelReferenceRange, + LabelNumber, + CommandDefinition, + MathOperator, + GlossaryEntryDefinition, + GlossaryEntryReference, + AcronymDefinition, + AcronymDeclaration, + AcronymReference, + TheoremDefinition, + ColorReference, + ColorDefinition, + ColorSetDefinition, + TikzLibraryImport, + EnvironmentDefinition, + GraphicsPath, + BeginBlockComment, + EndBlockComment, +} + +#[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Hash)] +pub enum SectionLevel { + Part, + Chapter, + Section, + Subsection, + Subsubsection, + Paragraph, + Subparagraph, +} diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@block_comments.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@block_comments.txt.snap index 14c73e7da5..1a12800267 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@block_comments.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@block_comments.txt.snap @@ -9,17 +9,21 @@ ROOT@0..48 WORD@0..3 "Foo" LINE_BREAK@3..4 "\n" BLOCK_COMMENT@4..22 - BEGIN_BLOCK_COMMENT_NAME@4..12 "\\iffalse" - VERBATIM@12..19 "\nTest1\n" - END_BLOCK_COMMENT_NAME@19..22 "\\fi" + COMMAND_NAME@4..12 "\\iffalse" + LINE_BREAK@12..13 "\n" + WORD@13..18 "Test1" + LINE_BREAK@18..19 "\n" + COMMAND_NAME@19..22 "\\fi" LINE_BREAK@22..23 "\n" TEXT@23..27 WORD@23..26 "Bar" LINE_BREAK@26..27 "\n" BLOCK_COMMENT@27..44 - BEGIN_BLOCK_COMMENT_NAME@27..35 "\\iffalse" - VERBATIM@35..41 "\n\\fii\n" - END_BLOCK_COMMENT_NAME@41..44 "\\fi" + COMMAND_NAME@27..35 "\\iffalse" + LINE_BREAK@35..36 "\n" + COMMAND_NAME@36..40 "\\fii" + LINE_BREAK@40..41 "\n" + COMMAND_NAME@41..44 "\\fi" LINE_BREAK@44..45 "\n" TEXT@45..48 WORD@45..48 "Baz" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_default.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_default.txt.snap index 33e119c524..8b314f42ad 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_default.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_default.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/caption/caption_default.txt ROOT@0..27 PREAMBLE@0..27 CAPTION@0..27 - CAPTION_NAME@0..8 "\\caption" + COMMAND_NAME@0..8 "\\caption" BRACK_GROUP@8..13 L_BRACK@8..9 "[" TEXT@9..12 @@ -18,7 +18,7 @@ ROOT@0..27 WORD@14..17 "Foo" WHITESPACE@17..18 " " GENERIC_COMMAND@18..23 - GENERIC_COMMAND_NAME@18..22 "\\Bar" + COMMAND_NAME@18..22 "\\Bar" WHITESPACE@22..23 " " TEXT@23..26 WORD@23..26 "Baz" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_default_error.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_default_error.txt.snap index a016dcebed..9bbabd4b56 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_default_error.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_default_error.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/caption/caption_default_error.txt ROOT@0..26 PREAMBLE@0..26 CAPTION@0..26 - CAPTION_NAME@0..8 "\\caption" + COMMAND_NAME@0..8 "\\caption" BRACK_GROUP@8..13 L_BRACK@8..9 "[" TEXT@9..12 @@ -18,9 +18,8 @@ ROOT@0..26 WORD@14..17 "Foo" WHITESPACE@17..18 " " GENERIC_COMMAND@18..23 - GENERIC_COMMAND_NAME@18..22 "\\Bar" + COMMAND_NAME@18..22 "\\Bar" WHITESPACE@22..23 " " TEXT@23..26 WORD@23..26 "Baz" - MISSING@26..26 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_figure.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_figure.txt.snap index 9303bd3ebe..4e12380396 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_figure.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_figure.txt.snap @@ -7,21 +7,21 @@ ROOT@0..39 PREAMBLE@0..39 ENVIRONMENT@0..39 BEGIN@0..14 - BEGIN_ENVIRONMENT_NAME@0..6 "\\begin" + COMMAND_NAME@0..6 "\\begin" CURLY_GROUP_WORD@6..14 L_CURLY@6..7 "{" KEY@7..13 WORD@7..13 "figure" R_CURLY@13..14 "}" CAPTION@14..27 - CAPTION_NAME@14..22 "\\caption" + COMMAND_NAME@14..22 "\\caption" CURLY_GROUP@22..27 L_CURLY@22..23 "{" TEXT@23..26 WORD@23..26 "Foo" R_CURLY@26..27 "}" END@27..39 - END_ENVIRONMENT_NAME@27..31 "\\end" + COMMAND_NAME@27..31 "\\end" CURLY_GROUP_WORD@31..39 L_CURLY@31..32 "{" KEY@32..38 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_minimal.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_minimal.txt.snap index 6af368cc21..9e0769dd57 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_minimal.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_minimal.txt.snap @@ -6,14 +6,14 @@ input_file: src/parser/test_data/latex/caption/caption_minimal.txt ROOT@0..22 PREAMBLE@0..22 CAPTION@0..22 - CAPTION_NAME@0..8 "\\caption" + COMMAND_NAME@0..8 "\\caption" CURLY_GROUP@8..22 L_CURLY@8..9 "{" TEXT@9..13 WORD@9..12 "Foo" WHITESPACE@12..13 " " GENERIC_COMMAND@13..18 - GENERIC_COMMAND_NAME@13..17 "\\Bar" + COMMAND_NAME@13..17 "\\Bar" WHITESPACE@17..18 " " TEXT@18..21 WORD@18..21 "Baz" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_minimal_error.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_minimal_error.txt.snap index 68fc629613..845f1f3682 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_minimal_error.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@caption__caption_minimal_error.txt.snap @@ -6,16 +6,15 @@ input_file: src/parser/test_data/latex/caption/caption_minimal_error.txt ROOT@0..21 PREAMBLE@0..21 CAPTION@0..21 - CAPTION_NAME@0..8 "\\caption" + COMMAND_NAME@0..8 "\\caption" CURLY_GROUP@8..21 L_CURLY@8..9 "{" TEXT@9..13 WORD@9..12 "Foo" WHITESPACE@12..13 " " GENERIC_COMMAND@13..18 - GENERIC_COMMAND_NAME@13..17 "\\Bar" + COMMAND_NAME@13..17 "\\Bar" WHITESPACE@17..18 " " TEXT@18..21 WORD@18..21 "Baz" - MISSING@21..21 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_empty.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_empty.txt.snap index fbf2b5123e..c075d59f77 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_empty.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_empty.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/citation/citation_empty.txt ROOT@0..7 PREAMBLE@0..7 CITATION@0..7 - CITATION_NAME@0..5 "\\cite" + COMMAND_NAME@0..5 "\\cite" CURLY_GROUP_WORD_LIST@5..7 L_CURLY@5..6 "{" R_CURLY@6..7 "}" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_missing_brace.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_missing_brace.txt.snap index 72bd618594..1a2993bfeb 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_missing_brace.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_missing_brace.txt.snap @@ -6,10 +6,9 @@ input_file: src/parser/test_data/latex/citation/citation_missing_brace.txt ROOT@0..9 PREAMBLE@0..9 CITATION@0..9 - CITATION_NAME@0..5 "\\cite" + COMMAND_NAME@0..5 "\\cite" CURLY_GROUP_WORD_LIST@5..9 L_CURLY@5..6 "{" KEY@6..9 WORD@6..9 "foo" - MISSING@9..9 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_multiple_keys.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_multiple_keys.txt.snap index 81716cf8b1..92ad9815e4 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_multiple_keys.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_multiple_keys.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/citation/citation_multiple_keys.txt ROOT@0..15 PREAMBLE@0..15 CITATION@0..15 - CITATION_NAME@0..5 "\\cite" + COMMAND_NAME@0..5 "\\cite" CURLY_GROUP_WORD_LIST@5..15 L_CURLY@5..6 "{" KEY@6..9 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_prenote.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_prenote.txt.snap index f5afdca536..a14278731f 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_prenote.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_prenote.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/citation/citation_prenote.txt ROOT@0..15 PREAMBLE@0..15 CITATION@0..15 - CITATION_NAME@0..5 "\\cite" + COMMAND_NAME@0..5 "\\cite" BRACK_GROUP@5..10 L_BRACK@5..6 "[" TEXT@6..9 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_prenote_postnote.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_prenote_postnote.txt.snap index feecca0435..96c3996286 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_prenote_postnote.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_prenote_postnote.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/citation/citation_prenote_postnote.txt ROOT@0..20 PREAMBLE@0..20 CITATION@0..20 - CITATION_NAME@0..5 "\\cite" + COMMAND_NAME@0..5 "\\cite" BRACK_GROUP@5..10 L_BRACK@5..6 "[" TEXT@6..9 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_redundant_comma.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_redundant_comma.txt.snap index 2a8acd1173..d97fad470c 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_redundant_comma.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_redundant_comma.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/citation/citation_redundant_comma.txt ROOT@0..12 PREAMBLE@0..12 CITATION@0..12 - CITATION_NAME@0..5 "\\cite" + COMMAND_NAME@0..5 "\\cite" CURLY_GROUP_WORD_LIST@5..12 L_CURLY@5..6 "{" COMMA@6..7 "," diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_simple.txt.snap index faa2e07155..3e2bb4cdf8 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/citation/citation_simple.txt ROOT@0..10 PREAMBLE@0..10 CITATION@0..10 - CITATION_NAME@0..5 "\\cite" + COMMAND_NAME@0..5 "\\cite" CURLY_GROUP_WORD_LIST@5..10 L_CURLY@5..6 "{" KEY@6..9 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_star.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_star.txt.snap index 3bcd74701c..7ab875d747 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_star.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@citation__citation_star.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/citation/citation_star.txt ROOT@0..10 PREAMBLE@0..10 CITATION@0..10 - CITATION_NAME@0..7 "\\nocite" + COMMAND_NAME@0..7 "\\nocite" CURLY_GROUP_WORD_LIST@7..10 L_CURLY@7..8 "{" KEY@8..9 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_definition_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_definition_simple.txt.snap index 163ea09071..92ec32991d 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_definition_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_definition_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/color/color_definition_simple.txt ROOT@0..33 PREAMBLE@0..33 COLOR_DEFINITION@0..33 - COLOR_DEFINITION_NAME@0..12 "\\definecolor" + COMMAND_NAME@0..12 "\\definecolor" CURLY_GROUP_WORD@12..17 L_CURLY@12..13 "{" KEY@13..16 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_reference_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_reference_simple.txt.snap index 0c68b5eae0..0033103085 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_reference_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_reference_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/color/color_reference_simple.txt ROOT@0..13 PREAMBLE@0..13 COLOR_REFERENCE@0..13 - COLOR_REFERENCE_NAME@0..6 "\\color" + COMMAND_NAME@0..6 "\\color" CURLY_GROUP_WORD@6..13 L_CURLY@6..7 "{" KEY@7..12 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error1.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error1.txt.snap index 2e3be43ecb..017f8aef82 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error1.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error1.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/color/color_set_definition_error1.txt ROOT@0..39 PREAMBLE@0..39 COLOR_SET_DEFINITION@0..39 - COLOR_SET_DEFINITION_NAME@0..15 "\\definecolorset" + COMMAND_NAME@0..15 "\\definecolorset" BRACK_GROUP_WORD@15..19 L_BRACK@15..16 "[" KEY@16..18 @@ -30,5 +30,4 @@ ROOT@0..39 KEY@35..38 WORD@35..38 "bar" R_CURLY@38..39 "}" - MISSING@39..39 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error2.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error2.txt.snap index ee15174688..984dfcbabb 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error2.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error2.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/color/color_set_definition_error2.txt ROOT@0..30 PREAMBLE@0..30 COLOR_SET_DEFINITION@0..30 - COLOR_SET_DEFINITION_NAME@0..15 "\\definecolorset" + COMMAND_NAME@0..15 "\\definecolorset" CURLY_GROUP_WORD_LIST@15..25 L_CURLY@15..16 "{" KEY@16..19 @@ -20,6 +20,4 @@ ROOT@0..30 KEY@26..29 WORD@26..29 "foo" R_CURLY@29..30 "}" - MISSING@30..30 "" - MISSING@30..30 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error3.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error3.txt.snap index 3416786dda..67fc1ed0bb 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error3.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error3.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/color/color_set_definition_error3.txt ROOT@0..25 PREAMBLE@0..25 COLOR_SET_DEFINITION@0..25 - COLOR_SET_DEFINITION_NAME@0..15 "\\definecolorset" + COMMAND_NAME@0..15 "\\definecolorset" CURLY_GROUP_WORD_LIST@15..25 L_CURLY@15..16 "{" KEY@16..19 @@ -15,7 +15,4 @@ ROOT@0..25 KEY@20..24 WORD@20..24 "HTML" R_CURLY@24..25 "}" - MISSING@25..25 "" - MISSING@25..25 "" - MISSING@25..25 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error4.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error4.txt.snap index 5c16d9d7a5..e939ab2230 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error4.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_error4.txt.snap @@ -6,9 +6,5 @@ input_file: src/parser/test_data/latex/color/color_set_definition_error4.txt ROOT@0..15 PREAMBLE@0..15 COLOR_SET_DEFINITION@0..15 - COLOR_SET_DEFINITION_NAME@0..15 "\\definecolorset" - MISSING@15..15 "" - MISSING@15..15 "" - MISSING@15..15 "" - MISSING@15..15 "" + COMMAND_NAME@0..15 "\\definecolorset" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_simple.txt.snap index a4cff9c7a1..b699543115 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@color__color_set_definition_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/color/color_set_definition_simple.txt ROOT@0..44 PREAMBLE@0..44 COLOR_SET_DEFINITION@0..44 - COLOR_SET_DEFINITION_NAME@0..15 "\\definecolorset" + COMMAND_NAME@0..15 "\\definecolorset" BRACK_GROUP_WORD@15..19 L_BRACK@15..16 "[" KEY@16..18 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_no_argc.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_no_argc.txt.snap index a10287b262..fac8dcb1e0 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_no_argc.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_no_argc.txt.snap @@ -6,10 +6,10 @@ input_file: src/parser/test_data/latex/command_definition/command_definition_no_ ROOT@0..22 PREAMBLE@0..22 COMMAND_DEFINITION@0..22 - COMMAND_DEFINITION_NAME@0..11 "\\newcommand" + COMMAND_NAME@0..11 "\\newcommand" CURLY_GROUP_COMMAND@11..17 L_CURLY@11..12 "{" - GENERIC_COMMAND_NAME@12..16 "\\foo" + COMMAND_NAME@12..16 "\\foo" R_CURLY@16..17 "}" CURLY_GROUP@17..22 L_CURLY@17..18 "{" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_no_impl.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_no_impl.txt.snap index ae9b54e0c8..0096ebbe60 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_no_impl.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_no_impl.txt.snap @@ -6,10 +6,9 @@ input_file: src/parser/test_data/latex/command_definition/command_definition_no_ ROOT@0..17 PREAMBLE@0..17 COMMAND_DEFINITION@0..17 - COMMAND_DEFINITION_NAME@0..11 "\\newcommand" + COMMAND_NAME@0..11 "\\newcommand" CURLY_GROUP_COMMAND@11..17 L_CURLY@11..12 "{" - GENERIC_COMMAND_NAME@12..16 "\\foo" + COMMAND_NAME@12..16 "\\foo" R_CURLY@16..17 "}" - MISSING@17..17 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_no_impl_error.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_no_impl_error.txt.snap index 2e1f2f2956..018824e5e2 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_no_impl_error.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_no_impl_error.txt.snap @@ -6,10 +6,8 @@ input_file: src/parser/test_data/latex/command_definition/command_definition_no_ ROOT@0..16 PREAMBLE@0..16 COMMAND_DEFINITION@0..16 - COMMAND_DEFINITION_NAME@0..11 "\\newcommand" + COMMAND_NAME@0..11 "\\newcommand" CURLY_GROUP_COMMAND@11..16 L_CURLY@11..12 "{" - GENERIC_COMMAND_NAME@12..16 "\\foo" - MISSING@16..16 "" - MISSING@16..16 "" + COMMAND_NAME@12..16 "\\foo" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_optional.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_optional.txt.snap index fe1a3ad6ec..3435088461 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_optional.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_optional.txt.snap @@ -6,10 +6,10 @@ input_file: src/parser/test_data/latex/command_definition/command_definition_opt ROOT@0..29 PREAMBLE@0..29 COMMAND_DEFINITION@0..29 - COMMAND_DEFINITION_NAME@0..11 "\\newcommand" + COMMAND_NAME@0..11 "\\newcommand" CURLY_GROUP_COMMAND@11..17 L_CURLY@11..12 "{" - GENERIC_COMMAND_NAME@12..16 "\\foo" + COMMAND_NAME@12..16 "\\foo" R_CURLY@16..17 "}" BRACK_GROUP_WORD@17..20 L_BRACK@17..18 "[" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_simple.txt.snap index 422fdd0d5b..806a0e2081 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_simple.txt.snap @@ -6,8 +6,7 @@ input_file: src/parser/test_data/latex/command_definition/command_definition_sim ROOT@0..23 PREAMBLE@0..23 COMMAND_DEFINITION@0..19 - COMMAND_DEFINITION_NAME@0..11 "\\newcommand" - MISSING@11..11 "" + COMMAND_NAME@0..11 "\\newcommand" BRACK_GROUP_WORD@11..14 L_BRACK@11..12 "[" KEY@12..13 @@ -16,7 +15,7 @@ ROOT@0..23 CURLY_GROUP@14..19 L_CURLY@14..15 "{" GENERIC_COMMAND@15..18 - GENERIC_COMMAND_NAME@15..18 "\\id" + COMMAND_NAME@15..18 "\\id" R_CURLY@18..19 "}" CURLY_GROUP@19..23 L_CURLY@19..20 "{" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_with_begin.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_with_begin.txt.snap index 9ee38a1796..2dfccb38dd 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_with_begin.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__command_definition_with_begin.txt.snap @@ -6,15 +6,15 @@ input_file: src/parser/test_data/latex/command_definition/command_definition_wit ROOT@0..80 PREAMBLE@0..80 COMMAND_DEFINITION@0..80 - COMMAND_DEFINITION_NAME@0..11 "\\newcommand" + COMMAND_NAME@0..11 "\\newcommand" CURLY_GROUP_COMMAND@11..35 L_CURLY@11..12 "{" - GENERIC_COMMAND_NAME@12..34 "\\CVSubHeadingListStart" + COMMAND_NAME@12..34 "\\CVSubHeadingListStart" R_CURLY@34..35 "}" CURLY_GROUP@35..80 L_CURLY@35..36 "{" BEGIN@36..79 - BEGIN_ENVIRONMENT_NAME@36..42 "\\begin" + COMMAND_NAME@36..42 "\\begin" CURLY_GROUP_WORD@42..51 L_CURLY@42..43 "{" KEY@43..50 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__math_operator_no_impl.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__math_operator_no_impl.txt.snap index 371d1272c4..4cdcd846b6 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__math_operator_no_impl.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__math_operator_no_impl.txt.snap @@ -6,10 +6,9 @@ input_file: src/parser/test_data/latex/command_definition/math_operator_no_impl. ROOT@0..26 PREAMBLE@0..26 MATH_OPERATOR@0..26 - MATH_OPERATOR_NAME@0..20 "\\DeclareMathOperator" + COMMAND_NAME@0..20 "\\DeclareMathOperator" CURLY_GROUP_COMMAND@20..26 L_CURLY@20..21 "{" - GENERIC_COMMAND_NAME@21..25 "\\foo" + COMMAND_NAME@21..25 "\\foo" R_CURLY@25..26 "}" - MISSING@26..26 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__math_operator_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__math_operator_simple.txt.snap index 004e6918e4..fe6beef40f 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__math_operator_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@command_definition__math_operator_simple.txt.snap @@ -6,10 +6,10 @@ input_file: src/parser/test_data/latex/command_definition/math_operator_simple.t ROOT@0..31 PREAMBLE@0..31 MATH_OPERATOR@0..31 - MATH_OPERATOR_NAME@0..20 "\\DeclareMathOperator" + COMMAND_NAME@0..20 "\\DeclareMathOperator" CURLY_GROUP_COMMAND@20..26 L_CURLY@20..21 "{" - GENERIC_COMMAND_NAME@21..25 "\\foo" + COMMAND_NAME@21..25 "\\foo" R_CURLY@25..26 "}" CURLY_GROUP@26..31 L_CURLY@26..27 "{" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_asymptote.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_asymptote.txt.snap index abbc71e6ed..a16c3a2563 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_asymptote.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_asymptote.txt.snap @@ -6,16 +6,33 @@ input_file: src/parser/test_data/latex/environment/environment_asymptote.txt ROOT@0..50 PREAMBLE@0..50 ENVIRONMENT@0..50 - BEGIN@0..11 - BEGIN_ENVIRONMENT_NAME@0..6 "\\begin" - CURLY_GROUP_WORD@6..11 + BEGIN@0..16 + COMMAND_NAME@0..6 "\\begin" + CURLY_GROUP_WORD@6..16 L_CURLY@6..7 "{" KEY@7..10 WORD@7..10 "asy" R_CURLY@10..11 "}" - VERBATIM@11..41 "\n printf(\"Hello Wo ..." + LINE_BREAK@11..12 "\n" + WHITESPACE@12..16 " " + TEXT@16..22 + WORD@16..22 "printf" + MIXED_GROUP@22..39 + L_PAREN@22..23 "(" + TEXT@23..35 + WORD@23..29 "\"Hello" + WHITESPACE@29..30 " " + WORD@30..35 "World" + GENERIC_COMMAND@35..37 + COMMAND_NAME@35..37 "\\n" + TEXT@37..38 + WORD@37..38 "\"" + R_PAREN@38..39 ")" + TEXT@39..41 + WORD@39..40 ";" + LINE_BREAK@40..41 "\n" END@41..50 - END_ENVIRONMENT_NAME@41..45 "\\end" + COMMAND_NAME@41..45 "\\end" CURLY_GROUP_WORD@45..50 L_CURLY@45..46 "{" KEY@46..49 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_definition.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_definition.txt.snap index fb45f5d35b..4a99a3b175 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_definition.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_definition.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/environment/environment_definition.txt ROOT@0..47 PREAMBLE@0..47 ENVIRONMENT_DEFINITION@0..47 - ENVIRONMENT_DEFINITION_NAME@0..15 "\\newenvironment" + COMMAND_NAME@0..15 "\\newenvironment" CURLY_GROUP_WORD@15..20 L_CURLY@15..16 "{" KEY@16..19 @@ -20,7 +20,7 @@ ROOT@0..47 CURLY_GROUP@23..36 L_CURLY@23..24 "{" GENERIC_COMMAND@24..35 - BEGIN_ENVIRONMENT_NAME@24..30 "\\begin" + COMMAND_NAME@24..30 "\\begin" CURLY_GROUP@30..35 L_CURLY@30..31 "{" TEXT@31..34 @@ -30,7 +30,7 @@ ROOT@0..47 CURLY_GROUP@36..47 L_CURLY@36..37 "{" GENERIC_COMMAND@37..46 - END_ENVIRONMENT_NAME@37..41 "\\end" + COMMAND_NAME@37..41 "\\end" CURLY_GROUP@41..46 L_CURLY@41..42 "{" TEXT@42..45 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_definition_optional_arg.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_definition_optional_arg.txt.snap index 10009e851b..c9304ff387 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_definition_optional_arg.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_definition_optional_arg.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/environment/environment_definition_option ROOT@0..44 PREAMBLE@0..44 ENVIRONMENT_DEFINITION@0..44 - ENVIRONMENT_DEFINITION_NAME@0..15 "\\newenvironment" + COMMAND_NAME@0..15 "\\newenvironment" CURLY_GROUP_WORD@15..20 L_CURLY@15..16 "{" KEY@16..19 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_nested.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_nested.txt.snap index e3274ef70e..35b8155fd8 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_nested.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_nested.txt.snap @@ -7,7 +7,7 @@ ROOT@0..43 PREAMBLE@0..43 ENVIRONMENT@0..43 BEGIN@0..12 - BEGIN_ENVIRONMENT_NAME@0..6 "\\begin" + COMMAND_NAME@0..6 "\\begin" CURLY_GROUP_WORD@6..12 L_CURLY@6..7 "{" KEY@7..10 @@ -16,7 +16,7 @@ ROOT@0..43 WHITESPACE@11..12 " " ENVIRONMENT@12..34 BEGIN@12..24 - BEGIN_ENVIRONMENT_NAME@12..18 "\\begin" + COMMAND_NAME@12..18 "\\begin" CURLY_GROUP_WORD@18..24 L_CURLY@18..19 "{" KEY@19..22 @@ -24,7 +24,7 @@ ROOT@0..43 R_CURLY@22..23 "}" WHITESPACE@23..24 " " END@24..34 - END_ENVIRONMENT_NAME@24..28 "\\end" + COMMAND_NAME@24..28 "\\end" CURLY_GROUP_WORD@28..34 L_CURLY@28..29 "{" KEY@29..32 @@ -32,7 +32,7 @@ ROOT@0..43 R_CURLY@32..33 "}" WHITESPACE@33..34 " " END@34..43 - END_ENVIRONMENT_NAME@34..38 "\\end" + COMMAND_NAME@34..38 "\\end" CURLY_GROUP_WORD@38..43 L_CURLY@38..39 "{" KEY@39..42 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_nested_missing_braces.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_nested_missing_braces.txt.snap index 698be0eae7..88f9d3b3fd 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_nested_missing_braces.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_nested_missing_braces.txt.snap @@ -7,16 +7,15 @@ ROOT@0..52 PREAMBLE@0..52 ENVIRONMENT@0..52 BEGIN@0..11 - BEGIN_ENVIRONMENT_NAME@0..6 "\\begin" + COMMAND_NAME@0..6 "\\begin" CURLY_GROUP_WORD@6..11 L_CURLY@6..7 "{" KEY@7..11 WORD@7..10 "foo" WHITESPACE@10..11 " " - MISSING@11..11 "" ENVIRONMENT@11..44 BEGIN@11..34 - BEGIN_ENVIRONMENT_NAME@11..17 "\\begin" + COMMAND_NAME@11..17 "\\begin" CURLY_GROUP_WORD@17..34 L_CURLY@17..18 "{" KEY@18..34 @@ -26,9 +25,8 @@ ROOT@0..52 WHITESPACE@27..28 " " WORD@28..33 "World" WHITESPACE@33..34 " " - MISSING@34..34 "" END@34..44 - END_ENVIRONMENT_NAME@34..38 "\\end" + COMMAND_NAME@34..38 "\\end" CURLY_GROUP_WORD@38..44 L_CURLY@38..39 "{" KEY@39..42 @@ -36,10 +34,9 @@ ROOT@0..52 R_CURLY@42..43 "}" WHITESPACE@43..44 " " END@44..52 - END_ENVIRONMENT_NAME@44..48 "\\end" + COMMAND_NAME@44..48 "\\end" CURLY_GROUP_WORD@48..52 L_CURLY@48..49 "{" KEY@49..52 WORD@49..52 "bar" - MISSING@52..52 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_simple.txt.snap index db57d39580..996237cd42 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@environment__environment_simple.txt.snap @@ -7,7 +7,7 @@ ROOT@0..33 PREAMBLE@0..33 ENVIRONMENT@0..33 BEGIN@0..12 - BEGIN_ENVIRONMENT_NAME@0..6 "\\begin" + COMMAND_NAME@0..6 "\\begin" CURLY_GROUP_WORD@6..12 L_CURLY@6..7 "{" KEY@7..10 @@ -20,7 +20,7 @@ ROOT@0..33 WORD@18..23 "World" WHITESPACE@23..24 " " END@24..33 - END_ENVIRONMENT_NAME@24..28 "\\end" + COMMAND_NAME@24..28 "\\end" CURLY_GROUP_WORD@28..33 L_CURLY@28..29 "{" KEY@29..32 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@equation.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@equation.txt.snap index 0974c69449..55b92d4afb 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@equation.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@equation.txt.snap @@ -6,12 +6,12 @@ input_file: src/parser/test_data/latex/equation.txt ROOT@0..13 PREAMBLE@0..13 EQUATION@0..13 - BEGIN_EQUATION_NAME@0..2 "\\[" + COMMAND_NAME@0..2 "\\[" WHITESPACE@2..3 " " TEXT@3..11 WORD@3..6 "foo" WHITESPACE@6..7 " " WORD@7..10 "bar" WHITESPACE@10..11 " " - END_EQUATION_NAME@11..13 "\\]" + COMMAND_NAME@11..13 "\\]" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@equation_missing_begin.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@equation_missing_begin.txt.snap index c649fc6a6a..57e520cf38 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@equation_missing_begin.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@equation_missing_begin.txt.snap @@ -7,7 +7,7 @@ ROOT@0..28 PREAMBLE@0..28 ENVIRONMENT@0..28 BEGIN@0..10 - BEGIN_ENVIRONMENT_NAME@0..6 "\\begin" + COMMAND_NAME@0..6 "\\begin" CURLY_GROUP_WORD@6..10 L_CURLY@6..7 "{" KEY@7..8 @@ -20,10 +20,10 @@ ROOT@0..28 WORD@14..17 "bar" WHITESPACE@17..18 " " GENERIC_COMMAND@18..21 - END_EQUATION_NAME@18..20 "\\]" + COMMAND_NAME@18..20 "\\]" WHITESPACE@20..21 " " END@21..28 - END_ENVIRONMENT_NAME@21..25 "\\end" + COMMAND_NAME@21..25 "\\end" CURLY_GROUP_WORD@25..28 L_CURLY@25..26 "{" KEY@26..27 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@generic_command_args.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@generic_command_args.txt.snap index 9fee38a855..0db73ad9aa 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@generic_command_args.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@generic_command_args.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/generic_command_args.txt ROOT@0..14 PREAMBLE@0..14 GENERIC_COMMAND@0..14 - GENERIC_COMMAND_NAME@0..4 "\\foo" + COMMAND_NAME@0..4 "\\foo" CURLY_GROUP@4..9 L_CURLY@4..5 "{" TEXT@5..8 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@generic_command_empty.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@generic_command_empty.txt.snap index dcd2382d02..1886dedea7 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@generic_command_empty.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@generic_command_empty.txt.snap @@ -6,5 +6,5 @@ input_file: src/parser/test_data/latex/generic_command_empty.txt ROOT@0..4 PREAMBLE@0..4 GENERIC_COMMAND@0..4 - GENERIC_COMMAND_NAME@0..4 "\\foo" + COMMAND_NAME@0..4 "\\foo" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@generic_command_escape.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@generic_command_escape.txt.snap index d7d88a32ce..6ae6cd50be 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@generic_command_escape.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@generic_command_escape.txt.snap @@ -6,5 +6,5 @@ input_file: src/parser/test_data/latex/generic_command_escape.txt ROOT@0..2 PREAMBLE@0..2 GENERIC_COMMAND@0..2 - GENERIC_COMMAND_NAME@0..2 "\\#" + COMMAND_NAME@0..2 "\\#" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_declaration.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_declaration.txt.snap index c1298e50fc..279817a877 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_declaration.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_declaration.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/glossary/acronym_declaration.txt ROOT@0..64 PREAMBLE@0..64 ACRONYM_DECLARATION@0..64 - ACRONYM_DECLARATION_NAME@0..15 "\\DeclareAcronym" + COMMAND_NAME@0..15 "\\DeclareAcronym" CURLY_GROUP_WORD@15..19 L_CURLY@15..16 "{" KEY@16..18 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_definition_options.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_definition_options.txt.snap index eac9b6e3ba..90388ec5ee 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_definition_options.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_definition_options.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/glossary/acronym_definition_options.txt ROOT@0..76 PREAMBLE@0..76 ACRONYM_DEFINITION@0..76 - ACRONYM_DEFINITION_NAME@0..11 "\\newacronym" + COMMAND_NAME@0..11 "\\newacronym" BRACK_GROUP_KEY_VALUE@11..43 L_BRACK@11..12 "[" KEY_VALUE_BODY@12..42 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_definition_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_definition_simple.txt.snap index e6bfe2a9d5..eadfed4596 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_definition_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_definition_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/glossary/acronym_definition_simple.txt ROOT@0..44 PREAMBLE@0..44 ACRONYM_DEFINITION@0..44 - ACRONYM_DEFINITION_NAME@0..11 "\\newacronym" + COMMAND_NAME@0..11 "\\newacronym" CURLY_GROUP_WORD@11..21 L_CURLY@11..12 "{" KEY@12..20 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_package.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_package.txt.snap index 9babc04165..25c03edbad 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_package.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_package.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/glossary/acronym_package.txt ROOT@0..35 PREAMBLE@0..35 ACRONYM_DEFINITION@0..35 - ACRONYM_DEFINITION_NAME@0..5 "\\acro" + COMMAND_NAME@0..5 "\\acro" CURLY_GROUP_WORD@5..10 L_CURLY@5..6 "{" KEY@6..9 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_reference_options.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_reference_options.txt.snap index 99a8fbc562..1edbf986f8 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_reference_options.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_reference_options.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/glossary/acronym_reference_options.txt ROOT@0..32 PREAMBLE@0..32 ACRONYM_REFERENCE@0..32 - ACRONYM_REFERENCE_NAME@0..9 "\\acrshort" + COMMAND_NAME@0..9 "\\acrshort" BRACK_GROUP_KEY_VALUE@9..22 L_BRACK@9..10 "[" KEY_VALUE_BODY@10..21 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_reference_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_reference_simple.txt.snap index 08effadf7e..38e68a3a33 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_reference_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__acronym_reference_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/glossary/acronym_reference_simple.txt ROOT@0..19 PREAMBLE@0..19 ACRONYM_REFERENCE@0..19 - ACRONYM_REFERENCE_NAME@0..9 "\\acrshort" + COMMAND_NAME@0..9 "\\acrshort" CURLY_GROUP_WORD@9..19 L_CURLY@9..10 "{" KEY@10..18 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__glossary_entry_definition_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__glossary_entry_definition_simple.txt.snap index 4ab51a0db3..901d0bf8c2 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__glossary_entry_definition_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__glossary_entry_definition_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/glossary/glossary_entry_definition_simple ROOT@0..39 PREAMBLE@0..39 GLOSSARY_ENTRY_DEFINITION@0..39 - GLOSSARY_ENTRY_DEFINITION_NAME@0..17 "\\newglossaryentry" + COMMAND_NAME@0..17 "\\newglossaryentry" CURLY_GROUP_WORD@17..22 L_CURLY@17..18 "{" KEY@18..21 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__glossary_entry_reference_options.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__glossary_entry_reference_options.txt.snap index d97e984b77..263f4a7146 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__glossary_entry_reference_options.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__glossary_entry_reference_options.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/glossary/glossary_entry_reference_options ROOT@0..25 PREAMBLE@0..25 GLOSSARY_ENTRY_REFERENCE@0..25 - GLOSSARY_ENTRY_REFERENCE_NAME@0..4 "\\gls" + COMMAND_NAME@0..4 "\\gls" BRACK_GROUP_KEY_VALUE@4..20 L_BRACK@4..5 "[" KEY_VALUE_BODY@5..19 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__glossary_entry_reference_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__glossary_entry_reference_simple.txt.snap index 8c8fb0c1e2..72713fee9a 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__glossary_entry_reference_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@glossary__glossary_entry_reference_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/glossary/glossary_entry_reference_simple. ROOT@0..9 PREAMBLE@0..9 GLOSSARY_ENTRY_REFERENCE@0..9 - GLOSSARY_ENTRY_REFERENCE_NAME@0..4 "\\gls" + COMMAND_NAME@0..4 "\\gls" CURLY_GROUP_WORD@4..9 L_CURLY@4..5 "{" KEY@5..8 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@graphics_path.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@graphics_path.txt.snap index 9067d36c7d..392c6f3b6e 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@graphics_path.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@graphics_path.txt.snap @@ -1,12 +1,12 @@ --- source: src/parser/latex.rs -assertion_line: 1361 expression: root +input_file: src/parser/test_data/latex/graphics_path.txt --- ROOT@0..28 PREAMBLE@0..28 GRAPHICS_PATH@0..28 - GRAPHICS_PATH_NAME@0..13 "\\graphicspath" + COMMAND_NAME@0..13 "\\graphicspath" CURLY_GROUP@13..28 L_CURLY@13..14 "{" CURLY_GROUP_WORD@14..27 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@graphics_path_command.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@graphics_path_command.txt.snap index 4092b2e8e9..34d958314d 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@graphics_path_command.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@graphics_path_command.txt.snap @@ -1,18 +1,18 @@ --- source: src/parser/latex.rs -assertion_line: 1348 expression: root +input_file: src/parser/test_data/latex/graphics_path_command.txt --- ROOT@0..32 PREAMBLE@0..32 GRAPHICS_PATH@0..32 - GRAPHICS_PATH_NAME@0..13 "\\graphicspath" + COMMAND_NAME@0..13 "\\graphicspath" CURLY_GROUP@13..32 L_CURLY@13..14 "{" CURLY_GROUP_WORD@14..31 L_CURLY@14..15 "{" KEY@15..30 - GENERIC_COMMAND_NAME@15..22 "\\subfix" + COMMAND_NAME@15..22 "\\subfix" CURLY_GROUP_WORD@22..30 L_CURLY@22..23 "{" KEY@23..29 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@graphics_path_options.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@graphics_path_options.txt.snap index 0eb034bbb3..88b92c1a3b 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@graphics_path_options.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@graphics_path_options.txt.snap @@ -1,12 +1,12 @@ --- source: src/parser/latex.rs -assertion_line: 1348 expression: root +input_file: src/parser/test_data/latex/graphics_path_options.txt --- ROOT@0..33 PREAMBLE@0..33 GRAPHICS_PATH@0..13 - GRAPHICS_PATH_NAME@0..13 "\\graphicspath" + COMMAND_NAME@0..13 "\\graphicspath" MIXED_GROUP@13..18 L_BRACK@13..14 "[" TEXT@14..17 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__curly_group_missing_end.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__curly_group_missing_end.txt.snap index 68969f9c11..bc3e6e68ef 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__curly_group_missing_end.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__curly_group_missing_end.txt.snap @@ -11,5 +11,4 @@ ROOT@0..12 WORD@1..6 "hello" WHITESPACE@6..7 " " WORD@7..12 "world" - MISSING@12..12 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__equation_missing_end.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__equation_missing_end.txt.snap index eae04433d1..fad46a2c97 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__equation_missing_end.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__equation_missing_end.txt.snap @@ -7,7 +7,7 @@ ROOT@0..28 PREAMBLE@0..28 ENVIRONMENT@0..28 BEGIN@0..10 - BEGIN_ENVIRONMENT_NAME@0..6 "\\begin" + COMMAND_NAME@0..6 "\\begin" CURLY_GROUP_WORD@6..10 L_CURLY@6..7 "{" KEY@7..8 @@ -15,16 +15,15 @@ ROOT@0..28 R_CURLY@8..9 "}" WHITESPACE@9..10 " " EQUATION@10..21 - BEGIN_EQUATION_NAME@10..12 "\\[" + COMMAND_NAME@10..12 "\\[" WHITESPACE@12..13 " " TEXT@13..21 WORD@13..16 "foo" WHITESPACE@16..17 " " WORD@17..20 "bar" WHITESPACE@20..21 " " - MISSING@21..21 "" END@21..28 - END_ENVIRONMENT_NAME@21..25 "\\end" + COMMAND_NAME@21..25 "\\end" CURLY_GROUP_WORD@25..28 L_CURLY@25..26 "{" KEY@26..27 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__escaped_brackets.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__escaped_brackets.txt.snap index a396d2e984..9046238457 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__escaped_brackets.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__escaped_brackets.txt.snap @@ -9,7 +9,6 @@ ROOT@0..6 L_CURLY@0..1 "{" MIXED_GROUP@1..2 L_BRACK@1..2 "[" - MISSING@2..2 "" R_CURLY@2..3 "}" CURLY_GROUP@3..6 L_CURLY@3..4 "{" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__unmatched_braces.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__unmatched_braces.txt.snap index 82d7e9db45..cb181c7fdb 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__unmatched_braces.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__unmatched_braces.txt.snap @@ -9,5 +9,4 @@ ROOT@0..2 R_CURLY@0..1 "}" CURLY_GROUP@1..2 L_CURLY@1..2 "{" - MISSING@2..2 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__unmatched_brackets.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__unmatched_brackets.txt.snap index 7dd82d48bc..8e8accd9fc 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__unmatched_brackets.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__unmatched_brackets.txt.snap @@ -9,5 +9,4 @@ ROOT@0..2 R_BRACK@0..1 "]" MIXED_GROUP@1..2 L_BRACK@1..2 "[" - MISSING@2..2 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__unmatched_brackets_with_group.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__unmatched_brackets_with_group.txt.snap index 3c45c0c14c..82c14ec404 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__unmatched_brackets_with_group.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@group__unmatched_brackets_with_group.txt.snap @@ -11,6 +11,5 @@ ROOT@0..4 R_BRACK@1..2 "]" MIXED_GROUP@2..3 L_BRACK@2..3 "[" - MISSING@3..3 "" R_CURLY@3..4 "}" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__biblatex_include_options.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__biblatex_include_options.txt.snap index 897d693fd0..9e0c086956 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__biblatex_include_options.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__biblatex_include_options.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/biblatex_include_options.txt ROOT@0..42 PREAMBLE@0..42 BIBLATEX_INCLUDE@0..42 - BIBLATEX_INCLUDE_NAME@0..15 "\\addbibresource" + COMMAND_NAME@0..15 "\\addbibresource" BRACK_GROUP_KEY_VALUE@15..29 L_BRACK@15..16 "[" KEY_VALUE_BODY@16..28 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__biblatex_include_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__biblatex_include_simple.txt.snap index a4be9c38cb..80c0afdc78 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__biblatex_include_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__biblatex_include_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/biblatex_include_simple.txt ROOT@0..28 PREAMBLE@0..28 BIBLATEX_INCLUDE@0..28 - BIBLATEX_INCLUDE_NAME@0..15 "\\addbibresource" + COMMAND_NAME@0..15 "\\addbibresource" CURLY_GROUP_WORD_LIST@15..28 L_CURLY@15..16 "{" KEY@16..27 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__bibtex_include_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__bibtex_include_simple.txt.snap index 0a8f9cd3f6..0273ad8d6b 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__bibtex_include_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__bibtex_include_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/bibtex_include_simple.txt ROOT@0..22 PREAMBLE@0..22 BIBTEX_INCLUDE@0..22 - BIBTEX_INCLUDE_NAME@0..13 "\\bibliography" + COMMAND_NAME@0..13 "\\bibliography" CURLY_GROUP_WORD_LIST@13..22 L_CURLY@13..14 "{" KEY@14..21 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__class_include_empty.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__class_include_empty.txt.snap index 37ea745308..68b9f3c94e 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__class_include_empty.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__class_include_empty.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/class_include_empty.txt ROOT@0..16 PREAMBLE@0..16 CLASS_INCLUDE@0..16 - CLASS_INCLUDE_NAME@0..14 "\\documentclass" + COMMAND_NAME@0..14 "\\documentclass" CURLY_GROUP_WORD_LIST@14..16 L_CURLY@14..15 "{" R_CURLY@15..16 "}" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__class_include_options.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__class_include_options.txt.snap index ff95f8358f..e501b654c4 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__class_include_options.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__class_include_options.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/class_include_options.txt ROOT@0..44 PREAMBLE@0..44 CLASS_INCLUDE@0..44 - CLASS_INCLUDE_NAME@0..14 "\\documentclass" + COMMAND_NAME@0..14 "\\documentclass" BRACK_GROUP_KEY_VALUE@14..35 L_BRACK@14..15 "[" KEY_VALUE_BODY@15..34 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__class_include_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__class_include_simple.txt.snap index 670fa2b902..5b4f6114a6 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__class_include_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__class_include_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/class_include_simple.txt ROOT@0..23 PREAMBLE@0..23 CLASS_INCLUDE@0..23 - CLASS_INCLUDE_NAME@0..14 "\\documentclass" + COMMAND_NAME@0..14 "\\documentclass" CURLY_GROUP_WORD_LIST@14..23 L_CURLY@14..15 "{" KEY@15..22 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_command.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_command.txt.snap index 0332499c66..ea3e96323d 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_command.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_command.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/graphics_include_command.txt ROOT@0..52 PREAMBLE@0..52 GRAPHICS_INCLUDE@0..52 - GRAPHICS_INCLUDE_NAME@0..16 "\\includegraphics" + COMMAND_NAME@0..16 "\\includegraphics" BRACK_GROUP_KEY_VALUE@16..37 L_BRACK@16..17 "[" KEY_VALUE_BODY@17..36 @@ -18,14 +18,14 @@ ROOT@0..52 TEXT@23..26 WORD@23..26 "0.5" GENERIC_COMMAND@26..36 - GENERIC_COMMAND_NAME@26..36 "\\textwidth" + COMMAND_NAME@26..36 "\\textwidth" R_BRACK@36..37 "]" CURLY_GROUP_WORD_LIST@37..52 L_CURLY@37..38 "{" KEY@38..51 - GENERIC_COMMAND_NAME@38..42 "\\foo" + COMMAND_NAME@38..42 "\\foo" WORD@42..43 "." - GENERIC_COMMAND_NAME@43..47 "\\bar" + COMMAND_NAME@43..47 "\\bar" WORD@47..51 ".pdf" R_CURLY@51..52 "}" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_complicated_options.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_complicated_options.txt.snap index 5259eb5072..3b60d765b8 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_complicated_options.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_complicated_options.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/graphics_include_complicated_opti ROOT@0..39 PREAMBLE@0..39 GRAPHICS_INCLUDE@0..39 - GRAPHICS_INCLUDE_NAME@0..16 "\\includegraphics" + COMMAND_NAME@0..16 "\\includegraphics" BRACK_GROUP_KEY_VALUE@16..37 L_BRACK@16..17 "[" KEY_VALUE_BODY@17..36 @@ -18,7 +18,7 @@ ROOT@0..39 TEXT@23..26 WORD@23..26 "0.5" GENERIC_COMMAND@26..36 - GENERIC_COMMAND_NAME@26..36 "\\textwidth" + COMMAND_NAME@26..36 "\\textwidth" R_BRACK@36..37 "]" CURLY_GROUP_WORD_LIST@37..39 L_CURLY@37..38 "{" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_options.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_options.txt.snap index 5ed7df9cfc..b0817db126 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_options.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_options.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/graphics_include_options.txt ROOT@0..39 PREAMBLE@0..39 GRAPHICS_INCLUDE@0..39 - GRAPHICS_INCLUDE_NAME@0..16 "\\includegraphics" + COMMAND_NAME@0..16 "\\includegraphics" BRACK_GROUP_KEY_VALUE@16..26 L_BRACK@16..17 "[" KEY_VALUE_BODY@17..25 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_simple.txt.snap index cabb065d24..ef53c6faa5 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__graphics_include_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/graphics_include_simple.txt ROOT@0..29 PREAMBLE@0..29 GRAPHICS_INCLUDE@0..29 - GRAPHICS_INCLUDE_NAME@0..16 "\\includegraphics" + COMMAND_NAME@0..16 "\\includegraphics" CURLY_GROUP_WORD_LIST@16..29 L_CURLY@16..17 "{" KEY@17..28 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__import_incomplete.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__import_incomplete.txt.snap index dad78222c2..b4fc1b4244 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__import_incomplete.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__import_incomplete.txt.snap @@ -6,11 +6,9 @@ input_file: src/parser/test_data/latex/include/import_incomplete.txt ROOT@0..11 PREAMBLE@0..11 IMPORT@0..11 - IMPORT_NAME@0..7 "\\import" + COMMAND_NAME@0..7 "\\import" CURLY_GROUP_WORD@7..11 L_CURLY@7..8 "{" KEY@8..11 WORD@8..11 "foo" - MISSING@11..11 "" - MISSING@11..11 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__import_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__import_simple.txt.snap index 9e4fdeb284..d703c0b994 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__import_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__import_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/import_simple.txt ROOT@0..17 PREAMBLE@0..17 IMPORT@0..17 - IMPORT_NAME@0..7 "\\import" + COMMAND_NAME@0..7 "\\import" CURLY_GROUP_WORD@7..12 L_CURLY@7..8 "{" KEY@8..11 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__inkscape_include_options.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__inkscape_include_options.txt.snap index d0e8321692..4594b959f3 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__inkscape_include_options.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__inkscape_include_options.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/inkscape_include_options.txt ROOT@0..30 PREAMBLE@0..30 SVG_INCLUDE@0..30 - SVG_INCLUDE_NAME@0..11 "\\includesvg" + COMMAND_NAME@0..11 "\\includesvg" BRACK_GROUP_KEY_VALUE@11..21 L_BRACK@11..12 "[" KEY_VALUE_BODY@12..20 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__inkscape_include_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__inkscape_include_simple.txt.snap index 1d1e68f33c..b74c855e53 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__inkscape_include_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__inkscape_include_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/inkscape_include_simple.txt ROOT@0..20 PREAMBLE@0..20 SVG_INCLUDE@0..20 - SVG_INCLUDE_NAME@0..11 "\\includesvg" + COMMAND_NAME@0..11 "\\includesvg" CURLY_GROUP_WORD_LIST@11..20 L_CURLY@11..12 "{" KEY@12..19 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__latex_include_equality_sign.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__latex_include_equality_sign.txt.snap index abf7865a42..f49d0ccea6 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__latex_include_equality_sign.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__latex_include_equality_sign.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/latex_include_equality_sign.txt ROOT@0..17 PREAMBLE@0..17 LATEX_INCLUDE@0..17 - LATEX_INCLUDE_NAME@0..8 "\\include" + COMMAND_NAME@0..8 "\\include" CURLY_GROUP_WORD_LIST@8..17 L_CURLY@8..9 "{" KEY@9..16 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__latex_include_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__latex_include_simple.txt.snap index 2315a2ad7c..1b853f4686 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__latex_include_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__latex_include_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/latex_include_simple.txt ROOT@0..17 PREAMBLE@0..17 LATEX_INCLUDE@0..17 - LATEX_INCLUDE_NAME@0..8 "\\include" + COMMAND_NAME@0..8 "\\include" CURLY_GROUP_WORD_LIST@8..17 L_CURLY@8..9 "{" KEY@9..16 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__latex_input_path_brackets.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__latex_input_path_brackets.txt.snap index 0ba79f0c41..dee2e19577 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__latex_input_path_brackets.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__latex_input_path_brackets.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/latex_input_path_brackets.txt ROOT@0..20 PREAMBLE@0..20 LATEX_INCLUDE@0..20 - LATEX_INCLUDE_NAME@0..6 "\\input" + COMMAND_NAME@0..6 "\\input" CURLY_GROUP_WORD_LIST@6..20 L_CURLY@6..7 "{" KEY@7..19 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_empty.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_empty.txt.snap index 36e2ab5aeb..c8746b66e5 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_empty.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_empty.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/package_include_empty.txt ROOT@0..13 PREAMBLE@0..13 PACKAGE_INCLUDE@0..13 - PACKAGE_INCLUDE_NAME@0..11 "\\usepackage" + COMMAND_NAME@0..11 "\\usepackage" CURLY_GROUP_WORD_LIST@11..13 L_CURLY@11..12 "{" R_CURLY@12..13 "}" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_multiple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_multiple.txt.snap index 876f7313d7..e6ca358d8b 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_multiple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_multiple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/package_include_multiple.txt ROOT@0..28 PREAMBLE@0..28 PACKAGE_INCLUDE@0..28 - PACKAGE_INCLUDE_NAME@0..11 "\\usepackage" + COMMAND_NAME@0..11 "\\usepackage" CURLY_GROUP_WORD_LIST@11..28 L_CURLY@11..12 "{" KEY@12..19 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_options.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_options.txt.snap index 32a624f769..a65948daf8 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_options.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_options.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/package_include_options.txt ROOT@0..41 PREAMBLE@0..41 PACKAGE_INCLUDE@0..41 - PACKAGE_INCLUDE_NAME@0..11 "\\usepackage" + COMMAND_NAME@0..11 "\\usepackage" BRACK_GROUP_KEY_VALUE@11..32 L_BRACK@11..12 "[" KEY_VALUE_BODY@12..31 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_simple.txt.snap index 014ed983dd..5f91723920 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__package_include_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/package_include_simple.txt ROOT@0..20 PREAMBLE@0..20 PACKAGE_INCLUDE@0..20 - PACKAGE_INCLUDE_NAME@0..11 "\\usepackage" + COMMAND_NAME@0..11 "\\usepackage" CURLY_GROUP_WORD_LIST@11..20 L_CURLY@11..12 "{" KEY@12..19 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__pgf_library_import_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__pgf_library_import_simple.txt.snap index 7f5f78415e..f20083a1bc 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__pgf_library_import_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__pgf_library_import_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/pgf_library_import_simple.txt ROOT@0..19 PREAMBLE@0..19 TIKZ_LIBRARY_IMPORT@0..19 - TIKZ_LIBRARY_IMPORT_NAME@0..14 "\\usepgflibrary" + COMMAND_NAME@0..14 "\\usepgflibrary" CURLY_GROUP_WORD_LIST@14..19 L_CURLY@14..15 "{" KEY@15..18 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__svg_include_options.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__svg_include_options.txt.snap index 2410aeaa5a..412e18691f 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__svg_include_options.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__svg_include_options.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/svg_include_options.txt ROOT@0..34 PREAMBLE@0..34 SVG_INCLUDE@0..34 - SVG_INCLUDE_NAME@0..11 "\\includesvg" + COMMAND_NAME@0..11 "\\includesvg" BRACK_GROUP_KEY_VALUE@11..21 L_BRACK@11..12 "[" KEY_VALUE_BODY@12..20 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__svg_include_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__svg_include_simple.txt.snap index 61dd22f045..da3a9b4a6d 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__svg_include_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__svg_include_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/svg_include_simple.txt ROOT@0..24 PREAMBLE@0..24 SVG_INCLUDE@0..24 - SVG_INCLUDE_NAME@0..11 "\\includesvg" + COMMAND_NAME@0..11 "\\includesvg" CURLY_GROUP_WORD_LIST@11..24 L_CURLY@11..12 "{" KEY@12..23 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__tikz_library_import_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__tikz_library_import_simple.txt.snap index c68ff02964..e44115196a 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__tikz_library_import_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__tikz_library_import_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/tikz_library_import_simple.txt ROOT@0..20 PREAMBLE@0..20 TIKZ_LIBRARY_IMPORT@0..20 - TIKZ_LIBRARY_IMPORT_NAME@0..15 "\\usetikzlibrary" + COMMAND_NAME@0..15 "\\usetikzlibrary" CURLY_GROUP_WORD_LIST@15..20 L_CURLY@15..16 "{" KEY@16..19 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__verbatim_include_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__verbatim_include_simple.txt.snap index 3c35fddf18..ffdc042047 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__verbatim_include_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@include__verbatim_include_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/include/verbatim_include_simple.txt ROOT@0..27 PREAMBLE@0..27 VERBATIM_INCLUDE@0..27 - VERBATIM_INCLUDE_NAME@0..14 "\\verbatiminput" + COMMAND_NAME@0..14 "\\verbatiminput" CURLY_GROUP_WORD_LIST@14..27 L_CURLY@14..15 "{" KEY@15..26 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@inline.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@inline.txt.snap index c055d183bd..fa5e02f35d 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@inline.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@inline.txt.snap @@ -11,7 +11,7 @@ ROOT@0..19 WORD@1..2 "x" WHITESPACE@2..3 " " GENERIC_COMMAND@3..18 - GENERIC_COMMAND_NAME@3..6 "\\in" + COMMAND_NAME@3..6 "\\in" WHITESPACE@6..7 " " MIXED_GROUP@7..18 L_BRACK@7..8 "[" @@ -20,7 +20,7 @@ ROOT@0..19 COMMA@9..10 "," WHITESPACE@10..11 " " GENERIC_COMMAND@11..17 - GENERIC_COMMAND_NAME@11..17 "\\infty" + COMMAND_NAME@11..17 "\\infty" R_PAREN@17..18 ")" DOLLAR@18..19 "$" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@inline_double_dollar.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@inline_double_dollar.txt.snap index 7084156fce..692cd065a1 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@inline_double_dollar.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@inline_double_dollar.txt.snap @@ -11,7 +11,7 @@ ROOT@0..21 WORD@2..3 "x" WHITESPACE@3..4 " " GENERIC_COMMAND@4..19 - GENERIC_COMMAND_NAME@4..7 "\\in" + COMMAND_NAME@4..7 "\\in" WHITESPACE@7..8 " " MIXED_GROUP@8..19 L_BRACK@8..9 "[" @@ -20,7 +20,7 @@ ROOT@0..21 COMMA@10..11 "," WHITESPACE@11..12 " " GENERIC_COMMAND@12..18 - GENERIC_COMMAND_NAME@12..18 "\\infty" + COMMAND_NAME@12..18 "\\infty" R_PAREN@18..19 ")" DOLLAR@19..21 "$$" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@issue_745.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@issue_745.txt.snap index 8530953285..1d9f6db48b 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@issue_745.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@issue_745.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/issue_745.txt ROOT@0..271 PREAMBLE@0..271 CLASS_INCLUDE@0..24 - CLASS_INCLUDE_NAME@0..14 "\\documentclass" + COMMAND_NAME@0..14 "\\documentclass" CURLY_GROUP_WORD_LIST@14..24 L_CURLY@14..15 "{" KEY@15..22 @@ -14,18 +14,19 @@ ROOT@0..271 R_CURLY@22..23 "}" LINE_BREAK@23..24 "\n" PACKAGE_INCLUDE@24..50 - PACKAGE_INCLUDE_NAME@24..35 "\\usepackage" + COMMAND_NAME@24..35 "\\usepackage" CURLY_GROUP_WORD_LIST@35..50 L_CURLY@35..36 "{" KEY@36..46 WORD@36..46 "tabularray" R_CURLY@46..47 "}" - WHITESPACE@47..50 " \n\n" + WHITESPACE@47..48 " " + LINE_BREAK@48..50 "\n\n" GENERIC_COMMAND@50..64 - GENERIC_COMMAND_NAME@50..63 "\\ExplSyntaxOn" + COMMAND_NAME@50..63 "\\ExplSyntaxOn" LINE_BREAK@63..64 "\n" GENERIC_COMMAND@64..223 - GENERIC_COMMAND_NAME@64..87 "\\NewDocumentEnvironment" + COMMAND_NAME@64..87 "\\NewDocumentEnvironment" CURLY_GROUP@87..96 L_CURLY@87..88 "{" TEXT@88..95 @@ -41,69 +42,79 @@ ROOT@0..271 TEXT@100..101 WORD@100..101 "m" R_CURLY@101..102 "}" - WHITESPACE@102..107 "\n " + LINE_BREAK@102..103 "\n" + WHITESPACE@103..107 " " CURLY_GROUP@107..200 L_CURLY@107..108 "{" - WHITESPACE@108..113 "\n " + LINE_BREAK@108..109 "\n" + WHITESPACE@109..113 " " GENERIC_COMMAND@113..194 - GENERIC_COMMAND_NAME@113..119 "\\use:x" - WHITESPACE@119..124 "\n " + COMMAND_NAME@113..119 "\\use:x" + LINE_BREAK@119..120 "\n" + WHITESPACE@120..124 " " CURLY_GROUP@124..194 L_CURLY@124..125 "{" - WHITESPACE@125..130 "\n " + LINE_BREAK@125..126 "\n" + WHITESPACE@126..130 " " GENERIC_COMMAND@130..141 - GENERIC_COMMAND_NAME@130..140 "\\exp_not:N" + COMMAND_NAME@130..140 "\\exp_not:N" WHITESPACE@140..141 " " ENVIRONMENT@141..188 BEGIN@141..179 - BEGIN_ENVIRONMENT_NAME@141..147 "\\begin" + COMMAND_NAME@141..147 "\\begin" CURLY_GROUP_WORD@147..158 L_CURLY@147..148 "{" KEY@148..152 WORD@148..152 "tblr" R_CURLY@152..153 "}" - WHITESPACE@153..158 "\n " + LINE_BREAK@153..154 "\n" + WHITESPACE@154..158 " " BRACK_GROUP@158..179 L_BRACK@158..159 "[" GENERIC_COMMAND@159..173 - GENERIC_COMMAND_NAME@159..169 "\\exp_not:n" + COMMAND_NAME@159..169 "\\exp_not:n" CURLY_GROUP@169..173 L_CURLY@169..170 "{" TEXT@170..172 WORD@170..172 "#1" R_CURLY@172..173 "}" R_BRACK@173..174 "]" - WHITESPACE@174..179 "\n " + LINE_BREAK@174..175 "\n" + WHITESPACE@175..179 " " CURLY_GROUP@179..188 L_CURLY@179..180 "{" TEXT@180..182 WORD@180..182 "#2" R_CURLY@182..183 "}" - WHITESPACE@183..188 "\n " - MISSING@188..188 "" + LINE_BREAK@183..184 "\n" + WHITESPACE@184..188 " " R_CURLY@188..189 "}" - WHITESPACE@189..194 "\n " + LINE_BREAK@189..190 "\n" + WHITESPACE@190..194 " " R_CURLY@194..195 "}" - WHITESPACE@195..200 "\n " + LINE_BREAK@195..196 "\n" + WHITESPACE@196..200 " " CURLY_GROUP@200..223 L_CURLY@200..201 "{" - WHITESPACE@201..206 "\n " + LINE_BREAK@201..202 "\n" + WHITESPACE@202..206 " " GENERIC_COMMAND@206..221 - END_ENVIRONMENT_NAME@206..210 "\\end" + COMMAND_NAME@206..210 "\\end" CURLY_GROUP@210..221 L_CURLY@210..211 "{" TEXT@211..215 WORD@211..215 "tblr" R_CURLY@215..216 "}" - WHITESPACE@216..221 "\n " + LINE_BREAK@216..217 "\n" + WHITESPACE@217..221 " " R_CURLY@221..222 "}" LINE_BREAK@222..223 "\n" GENERIC_COMMAND@223..239 - GENERIC_COMMAND_NAME@223..237 "\\ExplSyntaxOff" + COMMAND_NAME@223..237 "\\ExplSyntaxOff" LINE_BREAK@237..239 "\n\n" ENVIRONMENT@239..271 BEGIN@239..257 - BEGIN_ENVIRONMENT_NAME@239..245 "\\begin" + COMMAND_NAME@239..245 "\\begin" CURLY_GROUP_WORD@245..257 L_CURLY@245..246 "{" KEY@246..254 @@ -111,7 +122,7 @@ ROOT@0..271 R_CURLY@254..255 "}" LINE_BREAK@255..257 "\n\n" END@257..271 - END_ENVIRONMENT_NAME@257..261 "\\end" + COMMAND_NAME@257..261 "\\end" CURLY_GROUP_WORD@261..271 L_CURLY@261..262 "{" KEY@262..270 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@issue_789.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@issue_789.txt.snap index ff20c01008..4756b13c49 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@issue_789.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@issue_789.txt.snap @@ -1,12 +1,12 @@ --- source: src/parser/latex.rs -assertion_line: 1361 expression: root +input_file: src/parser/test_data/latex/issue_789.txt --- ROOT@0..19 PREAMBLE@0..19 GRAPHICS_PATH@0..19 - GRAPHICS_PATH_NAME@0..13 "\\graphicspath" + COMMAND_NAME@0..13 "\\graphicspath" CURLY_GROUP_WORD@13..19 L_CURLY@13..14 "{" KEY@14..18 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@issue_853.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@issue_853.txt.snap new file mode 100644 index 0000000000..0069449097 --- /dev/null +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@issue_853.txt.snap @@ -0,0 +1,62 @@ +--- +source: src/parser/latex.rs +expression: root +input_file: src/parser/test_data/latex/issue_853.txt +--- +ROOT@0..135 + PREAMBLE@0..135 + CLASS_INCLUDE@0..24 + COMMAND_NAME@0..14 "\\documentclass" + CURLY_GROUP_WORD_LIST@14..24 + L_CURLY@14..15 "{" + KEY@15..22 + WORD@15..22 "minimal" + R_CURLY@22..23 "}" + LINE_BREAK@23..24 "\n" + ENVIRONMENT@24..135 + BEGIN@24..41 + COMMAND_NAME@24..30 "\\begin" + CURLY_GROUP_WORD@30..41 + L_CURLY@30..31 "{" + KEY@31..39 + WORD@31..39 "document" + R_CURLY@39..40 "}" + LINE_BREAK@40..41 "\n" + TEXT@41..75 + WORD@41..45 "This" + WHITESPACE@45..46 " " + WORD@46..48 "is" + WHITESPACE@48..49 " " + WORD@49..51 "an" + WHITESPACE@51..52 " " + WORD@52..56 "asdf" + WHITESPACE@56..57 " " + WORD@57..66 "undefined" + WHITESPACE@66..67 " " + WORD@67..74 "command" + LINE_BREAK@74..75 "\n" + BLOCK_COMMENT@75..120 + COMMAND_NAME@75..83 "\\iffalse" + LINE_BREAK@83..84 "\n" + WHITESPACE@84..86 " " + BLOCK_COMMENT@86..97 + COMMAND_NAME@86..94 "\\iffalse" + COMMAND_NAME@94..97 "\\fi" + LINE_BREAK@97..98 "\n" + WHITESPACE@98..100 " " + COMMAND_NAME@100..104 "\\end" + L_CURLY@104..105 "{" + WORD@105..114 "enumerate" + R_CURLY@114..115 "}" + WHITESPACE@115..116 " " + LINE_BREAK@116..117 "\n" + COMMAND_NAME@117..120 "\\fi" + LINE_BREAK@120..121 "\n" + END@121..135 + COMMAND_NAME@121..125 "\\end" + CURLY_GROUP_WORD@125..135 + L_CURLY@125..126 "{" + KEY@126..134 + WORD@126..134 "document" + R_CURLY@134..135 "}" + diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@issue_857.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@issue_857.txt.snap new file mode 100644 index 0000000000..4ed4c71e59 --- /dev/null +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@issue_857.txt.snap @@ -0,0 +1,33 @@ +--- +source: src/parser/latex.rs +expression: root +input_file: src/parser/test_data/latex/issue_857.txt +--- +ROOT@0..55 + PREAMBLE@0..55 + COMMAND_DEFINITION@0..11 + COMMAND_NAME@0..11 "\\newcommand" + GENERIC_COMMAND@11..17 + COMMAND_NAME@11..14 "\\ö" + CURLY_GROUP@14..17 + L_CURLY@14..15 "{" + R_CURLY@15..16 "}" + LINE_BREAK@16..17 "\n" + COMMAND_DEFINITION@17..38 + COMMAND_NAME@17..28 "\\newcommand" + CURLY_GROUP_COMMAND@28..35 + L_CURLY@28..29 "{" + COMMAND_NAME@29..34 "\\öö" + R_CURLY@34..35 "}" + CURLY_GROUP@35..38 + L_CURLY@35..36 "{" + R_CURLY@36..37 "}" + LINE_BREAK@37..38 "\n" + COMMAND_DEFINITION@38..49 + COMMAND_NAME@38..49 "\\newcommand" + GENERIC_COMMAND@49..55 + COMMAND_NAME@49..53 "\\123" + CURLY_GROUP@53..55 + L_CURLY@53..54 "{" + R_CURLY@54..55 "}" + diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_definition_line_break.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_definition_line_break.txt.snap index 7f2ff377b8..57c3a3bf3a 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_definition_line_break.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_definition_line_break.txt.snap @@ -6,13 +6,12 @@ input_file: src/parser/test_data/latex/label/label_definition_line_break.txt ROOT@0..19 PREAMBLE@0..19 LABEL_DEFINITION@0..13 - LABEL_DEFINITION_NAME@0..6 "\\label" + COMMAND_NAME@0..6 "\\label" CURLY_GROUP_WORD@6..13 L_CURLY@6..7 "{" KEY@7..13 WORD@7..12 "hello" LINE_BREAK@12..13 "\n" - MISSING@13..13 "" TEXT@13..18 WORD@13..18 "world" ERROR@18..19 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_definition_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_definition_simple.txt.snap index a2e8b85b55..49c17d26eb 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_definition_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_definition_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/label/label_definition_simple.txt ROOT@0..11 PREAMBLE@0..11 LABEL_DEFINITION@0..11 - LABEL_DEFINITION_NAME@0..6 "\\label" + COMMAND_NAME@0..6 "\\label" CURLY_GROUP_WORD@6..11 L_CURLY@6..7 "{" KEY@7..10 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_number.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_number.txt.snap index 9afdf9e88e..cc5824ea16 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_number.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_number.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/label/label_number.txt ROOT@0..21 PREAMBLE@0..21 LABEL_NUMBER@0..21 - LABEL_NUMBER_NAME@0..9 "\\newlabel" + COMMAND_NAME@0..9 "\\newlabel" CURLY_GROUP_WORD@9..14 L_CURLY@9..10 "{" KEY@10..13 @@ -20,5 +20,4 @@ ROOT@0..21 WORD@16..19 "1.1" R_CURLY@19..20 "}" R_CURLY@20..21 "}" - MISSING@21..21 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_equation.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_equation.txt.snap index 93580e846e..c44c7a2c5c 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_equation.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_equation.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/label/label_reference_equation.txt ROOT@0..11 PREAMBLE@0..11 LABEL_REFERENCE@0..11 - LABEL_REFERENCE_NAME@0..6 "\\eqref" + COMMAND_NAME@0..6 "\\eqref" CURLY_GROUP_WORD_LIST@6..11 L_CURLY@6..7 "{" KEY@7..10 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_incomplete.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_incomplete.txt.snap index 64e2d9af44..c654786a3e 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_incomplete.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_incomplete.txt.snap @@ -9,7 +9,7 @@ ROOT@0..47 WORD@0..8 "Equation" WHITESPACE@8..9 " " LABEL_REFERENCE@9..24 - LABEL_REFERENCE_NAME@9..15 "\\eqref" + COMMAND_NAME@9..15 "\\eqref" CURLY_GROUP_WORD_LIST@15..24 L_CURLY@15..16 "{" KEY@16..24 @@ -19,9 +19,8 @@ ROOT@0..47 WHITESPACE@21..22 " " WORD@22..23 "a" WHITESPACE@23..24 " " - MISSING@24..24 "" GENERIC_COMMAND@24..38 - GENERIC_COMMAND_NAME@24..29 "\\emph" + COMMAND_NAME@24..29 "\\emph" CURLY_GROUP@29..38 L_CURLY@29..30 "{" TEXT@30..36 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_multiple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_multiple.txt.snap index 27d56c6789..556a04766e 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_multiple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_multiple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/label/label_reference_multiple.txt ROOT@0..14 PREAMBLE@0..14 LABEL_REFERENCE@0..14 - LABEL_REFERENCE_NAME@0..4 "\\ref" + COMMAND_NAME@0..4 "\\ref" CURLY_GROUP_WORD_LIST@4..14 L_CURLY@4..5 "{" KEY@5..8 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_range_error.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_range_error.txt.snap index ce5e6a49b5..ff82c6f558 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_range_error.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_range_error.txt.snap @@ -6,12 +6,11 @@ input_file: src/parser/test_data/latex/label/label_reference_range_error.txt ROOT@0..19 PREAMBLE@0..19 LABEL_REFERENCE_RANGE@0..19 - LABEL_REFERENCE_RANGE_NAME@0..10 "\\crefrange" + COMMAND_NAME@0..10 "\\crefrange" CURLY_GROUP_WORD@10..14 L_CURLY@10..11 "{" KEY@11..14 WORD@11..14 "foo" - MISSING@14..14 "" CURLY_GROUP_WORD@14..19 L_CURLY@14..15 "{" KEY@15..18 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_range_incomplete.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_range_incomplete.txt.snap index b682f40ebc..5a8910b8d2 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_range_incomplete.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_range_incomplete.txt.snap @@ -6,11 +6,10 @@ input_file: src/parser/test_data/latex/label/label_reference_range_incomplete.tx ROOT@0..15 PREAMBLE@0..15 LABEL_REFERENCE_RANGE@0..15 - LABEL_REFERENCE_RANGE_NAME@0..10 "\\crefrange" + COMMAND_NAME@0..10 "\\crefrange" CURLY_GROUP_WORD@10..15 L_CURLY@10..11 "{" KEY@11..14 WORD@11..14 "foo" R_CURLY@14..15 "}" - MISSING@15..15 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_range_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_range_simple.txt.snap index e76708bf43..a03632ff5b 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_range_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_range_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/label/label_reference_range_simple.txt ROOT@0..20 PREAMBLE@0..20 LABEL_REFERENCE_RANGE@0..20 - LABEL_REFERENCE_RANGE_NAME@0..10 "\\crefrange" + COMMAND_NAME@0..10 "\\crefrange" CURLY_GROUP_WORD@10..15 L_CURLY@10..11 "{" KEY@11..14 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_simple.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_simple.txt.snap index 398a6c1682..3734ba74f9 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_simple.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@label__label_reference_simple.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/label/label_reference_simple.txt ROOT@0..9 PREAMBLE@0..9 LABEL_REFERENCE@0..9 - LABEL_REFERENCE_NAME@0..4 "\\ref" + COMMAND_NAME@0..4 "\\ref" CURLY_GROUP_WORD_LIST@4..9 L_CURLY@4..5 "{" KEY@5..8 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_enum_item.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_enum_item.txt.snap index 4c6222045c..45bcb12842 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_enum_item.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_enum_item.txt.snap @@ -7,7 +7,7 @@ ROOT@0..60 PREAMBLE@0..60 ENVIRONMENT@0..60 BEGIN@0..18 - BEGIN_ENVIRONMENT_NAME@0..6 "\\begin" + COMMAND_NAME@0..6 "\\begin" CURLY_GROUP_WORD@6..18 L_CURLY@6..7 "{" KEY@7..16 @@ -15,13 +15,13 @@ ROOT@0..60 R_CURLY@16..17 "}" WHITESPACE@17..18 " " ENUM_ITEM@18..26 - ENUM_ITEM_NAME@18..23 "\\item" + COMMAND_NAME@18..23 "\\item" WHITESPACE@23..24 " " TEXT@24..26 WORD@24..25 "1" WHITESPACE@25..26 " " ENUM_ITEM@26..37 - ENUM_ITEM_NAME@26..31 "\\item" + COMMAND_NAME@26..31 "\\item" BRACK_GROUP@31..35 L_BRACK@31..32 "[" TEXT@32..33 @@ -32,13 +32,13 @@ ROOT@0..60 WORD@35..36 "2" WHITESPACE@36..37 " " ENUM_ITEM@37..45 - ENUM_ITEM_NAME@37..42 "\\item" + COMMAND_NAME@37..42 "\\item" WHITESPACE@42..43 " " TEXT@43..45 WORD@43..44 "3" WHITESPACE@44..45 " " END@45..60 - END_ENVIRONMENT_NAME@45..49 "\\end" + COMMAND_NAME@45..49 "\\end" CURLY_GROUP_WORD@49..60 L_CURLY@49..50 "{" KEY@50..59 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_invalid_nesting.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_invalid_nesting.txt.snap index c5f7aede51..877d7e28d4 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_invalid_nesting.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_invalid_nesting.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/structure/structure_invalid_nesting.txt ROOT@0..27 PREAMBLE@0..27 SECTION@0..14 - SECTION_NAME@0..8 "\\section" + COMMAND_NAME@0..8 "\\section" CURLY_GROUP@8..14 L_CURLY@8..9 "{" TEXT@9..12 @@ -14,7 +14,7 @@ ROOT@0..27 R_CURLY@12..13 "}" WHITESPACE@13..14 " " CHAPTER@14..27 - CHAPTER_NAME@14..22 "\\chapter" + COMMAND_NAME@14..22 "\\chapter" CURLY_GROUP@22..27 L_CURLY@22..23 "{" TEXT@23..26 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_nested.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_nested.txt.snap index 1f93b8c11f..e4a3cddc7b 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_nested.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_nested.txt.snap @@ -6,49 +6,49 @@ input_file: src/parser/test_data/latex/structure/structure_nested.txt ROOT@0..90 PREAMBLE@0..90 PART@0..90 - PART_NAME@0..5 "\\part" + COMMAND_NAME@0..5 "\\part" CURLY_GROUP@5..8 L_CURLY@5..6 "{" TEXT@6..7 WORD@6..7 "1" R_CURLY@7..8 "}" CHAPTER@8..90 - CHAPTER_NAME@8..16 "\\chapter" + COMMAND_NAME@8..16 "\\chapter" CURLY_GROUP@16..19 L_CURLY@16..17 "{" TEXT@17..18 WORD@17..18 "2" R_CURLY@18..19 "}" SECTION@19..90 - SECTION_NAME@19..27 "\\section" + COMMAND_NAME@19..27 "\\section" CURLY_GROUP@27..30 L_CURLY@27..28 "{" TEXT@28..29 WORD@28..29 "3" R_CURLY@29..30 "}" SUBSECTION@30..90 - SUBSECTION_NAME@30..41 "\\subsection" + COMMAND_NAME@30..41 "\\subsection" CURLY_GROUP@41..44 L_CURLY@41..42 "{" TEXT@42..43 WORD@42..43 "4" R_CURLY@43..44 "}" SUBSUBSECTION@44..90 - SUBSUBSECTION_NAME@44..58 "\\subsubsection" + COMMAND_NAME@44..58 "\\subsubsection" CURLY_GROUP@58..61 L_CURLY@58..59 "{" TEXT@59..60 WORD@59..60 "5" R_CURLY@60..61 "}" PARAGRAPH@61..90 - PARAGRAPH_NAME@61..71 "\\paragraph" + COMMAND_NAME@61..71 "\\paragraph" CURLY_GROUP@71..74 L_CURLY@71..72 "{" TEXT@72..73 WORD@72..73 "6" R_CURLY@73..74 "}" SUBPARAGRAPH@74..90 - SUBPARAGRAPH_NAME@74..87 "\\subparagraph" + COMMAND_NAME@74..87 "\\subparagraph" CURLY_GROUP@87..90 L_CURLY@87..88 "{" TEXT@88..89 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_siblings.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_siblings.txt.snap index 03a29cb4bd..4a925e7e44 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_siblings.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@structure__structure_siblings.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/structure/structure_siblings.txt ROOT@0..35 PREAMBLE@0..35 SECTION@0..18 - SECTION_NAME@0..8 "\\section" + COMMAND_NAME@0..8 "\\section" CURLY_GROUP@8..14 L_CURLY@8..9 "{" TEXT@9..12 @@ -17,7 +17,7 @@ ROOT@0..35 WORD@14..17 "Foo" WHITESPACE@17..18 " " SECTION@18..35 - SECTION_NAME@18..26 "\\section" + COMMAND_NAME@18..26 "\\section" CURLY_GROUP@26..32 L_CURLY@26..27 "{" TEXT@27..30 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_full.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_full.txt.snap index 81b9c92758..6aa441cbba 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_full.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_full.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/theorem_definition/theorem_definition_ful ROOT@0..31 PREAMBLE@0..31 THEOREM_DEFINITION@0..31 - THEOREM_DEFINITION_NAME@0..11 "\\newtheorem" + COMMAND_NAME@0..11 "\\newtheorem" CURLY_GROUP_WORD@11..16 L_CURLY@11..12 "{" KEY@12..15 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_name_with_counter.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_name_with_counter.txt.snap index b422a2619f..d205e65183 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_name_with_counter.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_name_with_counter.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/theorem_definition/theorem_definition_nam ROOT@0..21 PREAMBLE@0..21 THEOREM_DEFINITION@0..21 - THEOREM_DEFINITION_NAME@0..11 "\\newtheorem" + COMMAND_NAME@0..11 "\\newtheorem" CURLY_GROUP_WORD@11..16 L_CURLY@11..12 "{" KEY@12..15 @@ -17,5 +17,4 @@ ROOT@0..21 KEY@17..20 WORD@17..20 "bar" R_BRACK@20..21 "]" - MISSING@21..21 "" diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_name_with_description.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_name_with_description.txt.snap index 0b1a3f3e48..8d198b3940 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_name_with_description.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_name_with_description.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/theorem_definition/theorem_definition_nam ROOT@0..21 PREAMBLE@0..21 THEOREM_DEFINITION@0..21 - THEOREM_DEFINITION_NAME@0..11 "\\newtheorem" + COMMAND_NAME@0..11 "\\newtheorem" CURLY_GROUP_WORD@11..16 L_CURLY@11..12 "{" KEY@12..15 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_name_with_description_and_counter.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_name_with_description_and_counter.txt.snap index 1f84c653bd..ffa7d31541 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_name_with_description_and_counter.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_name_with_description_and_counter.txt.snap @@ -6,7 +6,7 @@ input_file: src/parser/test_data/latex/theorem_definition/theorem_definition_nam ROOT@0..26 PREAMBLE@0..26 THEOREM_DEFINITION@0..26 - THEOREM_DEFINITION_NAME@0..11 "\\newtheorem" + COMMAND_NAME@0..11 "\\newtheorem" CURLY_GROUP_WORD@11..16 L_CURLY@11..12 "{" KEY@12..15 diff --git a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_only_name.txt.snap b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_only_name.txt.snap index 8c85579665..afad760dd2 100644 --- a/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_only_name.txt.snap +++ b/support/texlab/src/parser/snapshots/texlab__parser__latex__tests__parse@theorem_definition__theorem_definition_only_name.txt.snap @@ -6,11 +6,10 @@ input_file: src/parser/test_data/latex/theorem_definition/theorem_definition_onl ROOT@0..16 PREAMBLE@0..16 THEOREM_DEFINITION@0..16 - THEOREM_DEFINITION_NAME@0..11 "\\newtheorem" + COMMAND_NAME@0..11 "\\newtheorem" CURLY_GROUP_WORD@11..16 L_CURLY@11..12 "{" KEY@12..15 WORD@12..15 "foo" R_CURLY@15..16 "}" - MISSING@16..16 "" diff --git a/support/texlab/src/parser/test_data/latex/issue_853.txt b/support/texlab/src/parser/test_data/latex/issue_853.txt new file mode 100644 index 0000000000..312889717c --- /dev/null +++ b/support/texlab/src/parser/test_data/latex/issue_853.txt @@ -0,0 +1,8 @@ +\documentclass{minimal} +\begin{document} +This is an asdf undefined command +\iffalse + \iffalse\fi + \end{enumerate} +\fi +\end{document}
\ No newline at end of file diff --git a/support/texlab/src/parser/test_data/latex/issue_857.txt b/support/texlab/src/parser/test_data/latex/issue_857.txt new file mode 100644 index 0000000000..0640263c84 --- /dev/null +++ b/support/texlab/src/parser/test_data/latex/issue_857.txt @@ -0,0 +1,3 @@ +\newcommand\ö{} +\newcommand{\öö}{} +\newcommand\123{}
\ No newline at end of file |