Skip to content

Commit

Permalink
[Ruby] Safe accessor
Browse files Browse the repository at this point in the history
Fixes #3813
  • Loading branch information
michaelblyons committed Dec 5, 2024
1 parent 1fb3a48 commit c532b31
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Ruby/Ruby.sublime-syntax
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ contexts:
pop: true

name-parts:
- match: ({{identifier}})?(?:(::)|(\.))
- match: ({{identifier}})?(?:(::)|(&?\.))
captures:
1: support.other.namespace.ruby
2: punctuation.accessor.double-colon.ruby
Expand Down Expand Up @@ -572,7 +572,7 @@ contexts:
- match: '!+|&&|\|\|'
scope: keyword.operator.logical.ruby
push: after-operator
- match: '[~&|^]'
- match: '(?:[~|^]|&(?!\.))'
scope: keyword.operator.bitwise.ruby
push: after-operator
- match: \?
Expand Down Expand Up @@ -626,7 +626,7 @@ contexts:
- match: ''
set: after-identifier
# This consumes attribute access so we don't need a lookbehind for .
- match: \.(?={{identifier}}{{method_punctuation}})
- match: '&?\.(?={{identifier}}{{method_punctuation}})'
scope: punctuation.accessor.dot.ruby
push:
- include: well-known-methods
Expand All @@ -637,7 +637,7 @@ contexts:
- match: '{{identifier}}{{method_punctuation}}'
# This consumes module/class accessor so we don't need a lookbehind for ::
push: after-identifier
- match: \.
- match: '&?\.'
scope: punctuation.accessor.dot.ruby
- match: '::'
scope: punctuation.accessor.double-colon.ruby
Expand Down

0 comments on commit c532b31

Please sign in to comment.