diff --git a/Ruby/Ruby.sublime-syntax b/Ruby/Ruby.sublime-syntax index 3d4bd81426..bf93540480 100644 --- a/Ruby/Ruby.sublime-syntax +++ b/Ruby/Ruby.sublime-syntax @@ -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 @@ -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: \? @@ -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 @@ -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