Skip to content

Commit

Permalink
Fix word boundary regexes in Ruby grammar (#2984)
Browse files Browse the repository at this point in the history
### Motivation

As pointed out in #2371 (comment), `\b` is indeed incorrect. All regexes inside the JSON grammar have to be escaped and so word boundary is `\\b`.

### Implementation

Added the missing backslashes.
  • Loading branch information
vinistock authored Dec 16, 2024
1 parent fface59 commit e415bab
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vscode/grammars/ruby.cson.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
}
},
"comment": "class Namespace::ClassName < OtherNamespace::OtherClassName",
"match": "\b(class)\\s+(([a-zA-Z0-9_]+)((::)[a-zA-Z0-9_]+)*)\\s*((<)\\s*(([a-zA-Z0-9_]+)((::)[a-zA-Z0-9_]+)*))?",
"match": "\\b(class)\\s+(([a-zA-Z0-9_]+)((::)[a-zA-Z0-9_]+)*)\\s*((<)\\s*(([a-zA-Z0-9_]+)((::)[a-zA-Z0-9_]+)*))?",
"name": "meta.class.ruby"
},
{
Expand All @@ -80,7 +80,7 @@
"name": "punctuation.separator.namespace.ruby"
}
},
"match": "\b(module)\\s+(([a-zA-Z0-9_]+)((::)[a-zA-Z0-9_]+)*)",
"match": "\\b(module)\\s+(([a-zA-Z0-9_]+)((::)[a-zA-Z0-9_]+)*)",
"name": "meta.module.ruby"
},
{
Expand All @@ -92,7 +92,7 @@
"name": "punctuation.separator.inheritance.ruby"
}
},
"match": "\b(class)\\s*(<<)\\s*",
"match": "\\b(class)\\s*(<<)\\s*",
"name": "meta.class.ruby"
},
{
Expand Down

0 comments on commit e415bab

Please sign in to comment.