ThirdParty/Pygments/pygments/lexers/ruby.py

changeset 4697
c2e9bf425554
parent 4172
4f20dba37ab6
child 5713
6762afd9f963
--- a/ThirdParty/Pygments/pygments/lexers/ruby.py	Sun Jan 24 16:15:58 2016 +0100
+++ b/ThirdParty/Pygments/pygments/lexers/ruby.py	Sun Jan 24 19:28:37 2016 +0100
@@ -5,7 +5,7 @@
 
     Lexers for Ruby and related languages.
 
-    :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -36,7 +36,7 @@
     name = 'Ruby'
     aliases = ['rb', 'ruby', 'duby']
     filenames = ['*.rb', '*.rbw', 'Rakefile', '*.rake', '*.gemspec',
-                 '*.rbx', '*.duby']
+                 '*.rbx', '*.duby', 'Gemfile']
     mimetypes = ['text/x-ruby', 'application/x-ruby']
 
     flags = re.DOTALL | re.MULTILINE
@@ -190,6 +190,7 @@
 
     tokens = {
         'root': [
+            (r'\A#!.+?$', Comment.Hashbang),
             (r'#.*?$', Comment.Single),
             (r'=begin\s.*?\n=end.*?$', Comment.Multiline),
             # keywords
@@ -256,13 +257,13 @@
              r'(?<=(?:\s|;)when\s)|'
              r'(?<=(?:\s|;)or\s)|'
              r'(?<=(?:\s|;)and\s)|'
-             r'(?<=(?:\s|;|\.)index\s)|'
-             r'(?<=(?:\s|;|\.)scan\s)|'
-             r'(?<=(?:\s|;|\.)sub\s)|'
-             r'(?<=(?:\s|;|\.)sub!\s)|'
-             r'(?<=(?:\s|;|\.)gsub\s)|'
-             r'(?<=(?:\s|;|\.)gsub!\s)|'
-             r'(?<=(?:\s|;|\.)match\s)|'
+             r'(?<=\.index\s)|'
+             r'(?<=\.scan\s)|'
+             r'(?<=\.sub\s)|'
+             r'(?<=\.sub!\s)|'
+             r'(?<=\.gsub\s)|'
+             r'(?<=\.gsub!\s)|'
+             r'(?<=\.match\s)|'
              r'(?<=(?:\s|;)if\s)|'
              r'(?<=(?:\s|;)elsif\s)|'
              r'(?<=^when\s)|'

eric ide

mercurial