Skip to content

Commit 8a85a9d

Browse files
committed
Fix range operator to support beginless and endless ranges
1 parent 0e1d0e7 commit 8a85a9d

4 files changed

Lines changed: 4 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# CHANGELOG
22
## master (Unreleased)
3+
- Fix range operator to support beginless and endless ranges
34
- Fix `erb` block comments to add `<%#` to each line
45
```erb
56
<ul>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ This Extension allows for Ruby Syntax Support without needing to install languag
2020
### Diffs
2121
- Added Grammar for `Gemfile` following [bundler docs](https://bundler.io/man/gemfile.5.html)
2222
- Added Ternary `:`
23-
- Added Ruby Range `..`
23+
- Added Ruby Ranges `..` / `...`
2424
- Fixed variable recognition ending with `?` or `!`
2525
- Fixed Comment Blocks for `.erb` files by adding `<%#` to each line
2626
- Fixed multiline arithmetic operations and regex matching collisions

syntaxes/ruby.tmLanguage.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2126,7 +2126,7 @@
21262126
"name": "keyword.operator.logical.ruby"
21272127
},
21282128
{
2129-
"match": "(?<=[^\\.\\s])\\.{2,3}(?=[^\\.\\s])",
2129+
"match": "(?<=[^\\.])\\.{2,3}|\\.{2,3}(?=[^\\.])",
21302130
"name": "keyword.operator.range.ruby"
21312131
},
21322132
{

syntaxes/yamls/ruby.tmLanguage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1261,7 +1261,7 @@ patterns:
12611261
name: keyword.operator.logical.ruby
12621262
- match: (?<=^|[ \t!])!|&&|\|\||\^
12631263
name: keyword.operator.logical.ruby
1264-
- match: (?<=[^\.\s])\.{2,3}(?=[^\.\s])
1264+
- match: (?<=[^\.])\.{2,3}|\.{2,3}(?=[^\.])
12651265
name: keyword.operator.range.ruby
12661266
- comment: Safe navigation operator
12671267
match: (&\.)\s*(?![A-Z])

0 commit comments

Comments
 (0)