summaryrefslogtreecommitdiff
path: root/lib/coderay/scanners/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'lib/coderay/scanners/ruby')
-rw-r--r--lib/coderay/scanners/ruby/patterns.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/coderay/scanners/ruby/patterns.rb b/lib/coderay/scanners/ruby/patterns.rb
index e303894..cf5f8c1 100644
--- a/lib/coderay/scanners/ruby/patterns.rb
+++ b/lib/coderay/scanners/ruby/patterns.rb
@@ -31,18 +31,18 @@ module Scanners
add(RESERVED_WORDS, :reserved).
add(PREDEFINED_CONSTANTS, :pre_constant)
- IDENT = /[a-z_][\w_]*/i
+ IDENT = /[^\W\d]\w*/
METHOD_NAME = / #{IDENT} [?!]? /ox
METHOD_NAME_OPERATOR = /
\*\*? # multiplication and power
- | [-+~]@? # plus, minus, tilde with and without @
- | [\/%&|^`] # division, modulo or format strings, &and, |or, ^xor, `system`
+ | [-+~]@? # plus, minus, tilde with and without at sign
+ | [\/%&|^`] # division, modulo or format strings, and, or, xor, system
| \[\]=? # array getter and setter
| << | >> # append or shift left, shift right
| <=?>? | >=? # comparison, rocket operator
| ===? | =~ # simple equality, case equality, match
- | ![~=@]? # negation with and without @, not-equal and not-match
+ | ![~=@]? # negation with and without at sign, not-equal and not-match
/ox
METHOD_NAME_EX = / #{IDENT} (?:[?!]|=(?!>))? | #{METHOD_NAME_OPERATOR} /ox
INSTANCE_VARIABLE = / @ #{IDENT} /ox