Skip to content

Commit

Permalink
Merge pull request #464 from BetterThanTomorrow/fix/lexing-regex
Browse files Browse the repository at this point in the history
Fix: Lexing regex literal tokenisation
  • Loading branch information
PEZ authored Nov 12, 2019
2 parents d6481d5 + 49a5665 commit 0d1784d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Changes to Calva.

## [Unreleased]
- [Fix: Lexing regex literal tokenisation](https://github.com/BetterThanTomorrow/calva/issues/463)

## [2.0.60] - 2019-11-11
- Re-enable default stylings for nREPL status bar items.
Expand Down
4 changes: 2 additions & 2 deletions src/webview/clojure-lexer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ toplevel.terminal(/:[^()[\]\{\}#,~@'`^\"\s;]*/, (l, m) => ({ type: "kw" }))
toplevel.terminal(/[^()[\]\{\}#,~@'`^\"\s:;][^()[\]\{\}#,~@'`^\"\s;]*/, (l, m) => ({ type: "id" }))

// complete string on a single line
toplevel.terminal(/"([^"\\]|\\.)*"/, (l, m) => ({ type: "str" }))
toplevel.terminal(/"([^"\\]|\\.)*/, (l, m) => ({ type: "str-start" }))
toplevel.terminal(/#?"([^"\\]|\\.)*"/, (l, m) => ({ type: "str" }))
toplevel.terminal(/#?"([^"\\]|\\.)*/, (l, m) => ({ type: "str-start" }))
toplevel.terminal(/./, (l, m) => ({ type: "junk" }))

/** This is the multi-line string grammar. It spits out 'str-end' once it is time to switch back to the 'toplevel' grammar, and 'str-inside' if the string continues. */
Expand Down

0 comments on commit 0d1784d

Please sign in to comment.