Skip to content

Commit

Permalink
fix: support more languages
Browse files Browse the repository at this point in the history
  • Loading branch information
antfu committed Aug 30, 2024
1 parent 55526bb commit e4f70ec
Show file tree
Hide file tree
Showing 5 changed files with 766 additions and 4 deletions.
2 changes: 2 additions & 0 deletions packages/core/src/engines/javascript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export class JavaScriptScanner implements PatternScanner {
try {
const regex = onigurumaToRegexp(
p
.replace(/\|\\G(\||\))/g, '$1')
.replace(/(\(|\|)\\G\|/g, '$1')
// YAML specific handling; TODO: move to tm-grammars
.replaceAll('[^\\s[-?:,\\[\\]{}#&*!|>\'"%@`]]', '[^\\s\\-?:,\\[\\]{}#&*!|>\'"%@`]'),
{
Expand Down
Loading

0 comments on commit e4f70ec

Please sign in to comment.