Skip to content

Commit

Permalink
Don't report parse errors for paths with env vars (#934)
Browse files Browse the repository at this point in the history
Fixes #931.
  • Loading branch information
pfoerster authored Sep 30, 2023
1 parent 2d0839a commit bb437e2
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix loading bibliographies from `kpathsea` search path ([#923](https://github.com/latex-lsp/texlab/issues/923))
- Don't report duplicate results when using goto definition on includes ([#924](https://github.com/latex-lsp/texlab/issues/924))
- Fix project detection when there exist files with the same name ([#923](https://github.com/latex-lsp/texlab/issues/923))
- Do not report parse errors with `$` in paths ([#931](https://github.com/latex-lsp/texlab/issues/931))

## [5.9.2] - 2023-08-14

Expand Down
3 changes: 3 additions & 0 deletions crates/parser/src/latex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ impl<'a> Parser<'a> {
| Token::Comma
| Token::LBrack
| Token::RBrack
| Token::Dollar
| Token::CommandName(CommandName::Generic) => self.path(),
Token::LCurly => self.curly_group_path(),
Token::Whitespace | Token::Pipe => self.eat(),
Expand All @@ -738,6 +739,7 @@ impl<'a> Parser<'a> {
| Token::RBrack
| Token::LParen
| Token::RParen
| Token::Dollar
| Token::CommandName(CommandName::Generic) => self.path(),
Token::Whitespace
| Token::LineBreak
Expand Down Expand Up @@ -767,6 +769,7 @@ impl<'a> Parser<'a> {
| Token::RBrack
| Token::LParen
| Token::RParen
| Token::Dollar
| Token::CommandName(CommandName::Generic) => self.eat(),
Token::LCurly => self.curly_group_path(),
_ => break,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
source: crates/parser/src/latex.rs
expression: root
input_file: crates/parser/src/test_data/latex/issue_931.txt
---
ROOT@0..31
PREAMBLE@0..31
BIBTEX_INCLUDE@0..31
COMMAND_NAME@0..13 "\\bibliography"
CURLY_GROUP_WORD_LIST@13..31
L_CURLY@13..14 "{"
KEY@14..30
DOLLAR@14..15 "$"
WORD@15..30 "HOME/Literature"
R_CURLY@30..31 "}"

1 change: 1 addition & 0 deletions crates/parser/src/test_data/latex/issue_931.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
\bibliography{$HOME/Literature}

0 comments on commit bb437e2

Please sign in to comment.