summaryrefslogtreecommitdiff
path: root/support/texlab/crates/parser/src/latex.rs
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2024-10-27 03:03:33 +0000
committerNorbert Preining <norbert@preining.info>2024-10-27 03:03:33 +0000
commitade38177952984be4fbae56a1f8d212db1d2b689 (patch)
tree1ed7e11480908e7bfab6d3edee14fe2a0e040817 /support/texlab/crates/parser/src/latex.rs
parentbcdaee1dcafa3d6898089a20f60acf2aee48c3e5 (diff)
CTAN sync 202410270303
Diffstat (limited to 'support/texlab/crates/parser/src/latex.rs')
-rw-r--r--support/texlab/crates/parser/src/latex.rs62
1 files changed, 61 insertions, 1 deletions
diff --git a/support/texlab/crates/parser/src/latex.rs b/support/texlab/crates/parser/src/latex.rs
index 669ba82f99..8379d9c5ca 100644
--- a/support/texlab/crates/parser/src/latex.rs
+++ b/support/texlab/crates/parser/src/latex.rs
@@ -158,6 +158,9 @@ impl<'a> Parser<'a> {
CommandName::EndBlockComment => self.generic_command(),
CommandName::VerbatimBlock => self.verbatim_block(),
CommandName::GraphicsPath => self.graphics_path(),
+ CommandName::BibItem => self.bibitem(),
+ CommandName::TocContentsLine => self.toc_contents_line(),
+ CommandName::TocNumberLine => self.toc_number_line(),
},
}
}
@@ -862,7 +865,20 @@ impl<'a> Parser<'a> {
}
if self.lexer.peek() == Some(Token::LCurly) {
- self.curly_group_word();
+ self.builder.start_node(CURLY_GROUP_WORD.into());
+ self.eat();
+ self.trivia();
+
+ if self.peek() == Some(Token::Word) || self.peek() == Some(Token::Pipe) {
+ self.key();
+ }
+
+ if let Some(Token::CommandName(_)) = self.peek() {
+ self.content(ParserContext::default());
+ }
+
+ self.expect(Token::RCurly);
+ self.builder.finish_node();
}
self.builder.finish_node();
@@ -1235,6 +1251,50 @@ impl<'a> Parser<'a> {
}
}
}
+
+ fn bibitem(&mut self) {
+ self.builder.start_node(BIBITEM.into());
+ self.eat();
+ self.trivia();
+
+ if self.lexer.peek() == Some(Token::LCurly) {
+ self.curly_group_word();
+ }
+
+ self.builder.finish_node();
+ }
+
+ fn toc_contents_line(&mut self) {
+ self.builder.start_node(TOC_CONTENTS_LINE.into());
+ self.eat();
+ self.trivia();
+
+ if self.lexer.peek() == Some(Token::LCurly) {
+ self.curly_group();
+ }
+
+ if self.lexer.peek() == Some(Token::LCurly) {
+ self.curly_group();
+ }
+
+ if self.lexer.peek() == Some(Token::LCurly) {
+ self.curly_group();
+ }
+
+ self.builder.finish_node();
+ }
+
+ fn toc_number_line(&mut self) {
+ self.builder.start_node(TOC_NUMBER_LINE.into());
+ self.eat();
+ self.trivia();
+
+ if self.lexer.peek() == Some(Token::LCurly) {
+ self.curly_group();
+ }
+
+ self.builder.finish_node();
+ }
}
pub fn parse_latex(text: &str, config: &SyntaxConfig) -> GreenNode {