aboutsummaryrefslogtreecommitdiffstats
path: root/defs
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-17 12:42:00 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-17 12:42:00 +0000
commit0201900d76c9b05000924dd74b98892db7be3d6e (patch)
tree90f7e0f7b3229c25317e4c86f179f2cf43892e9a /defs
parent5a6a502ef9d88a77f701be8e0dde8fa489eb1e1f (diff)
downloadruby-0201900d76c9b05000924dd74b98892db7be3d6e.tar.gz
id.def: $~ and $_
* defs/id.def (predefined): add idLASTLINE and idBACKREF for $~ and $_ respectively. * parse.y: use idLASTLINE and idBACKREF instead of rb_intern. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'defs')
-rw-r--r--defs/id.def5
1 files changed, 4 insertions, 1 deletions
diff --git a/defs/id.def b/defs/id.def
index 1ff0d9aa3d..e186725770 100644
--- a/defs/id.def
+++ b/defs/id.def
@@ -62,6 +62,9 @@ firstline, predefined = __LINE__+1, %[\
core#hash_merge_kwd
- debug#created_info
+
+ $_ LASTLINE
+ $~ BACKREF
]
# VM ID OP Parser Token
@@ -145,7 +148,7 @@ predefined.split(/^/).each_with_index do |line, num|
case name
when /\A[A-Z]\w*\z/; const_ids
when /\A(?!\d)\w+\z/; local_ids
- when /\A\$(?:\d+|(?!\d)\w+)\z/; global_ids
+ when /\A\$(?:\d+|(?!\d)\w+|\W)\z/; global_ids
when /\A@@(?!\d)\w+\z/; class_ids
when /\A@(?!\d)\w+\z/; instance_ids
when /\A((?!\d)\w+)=\z/; attrset_ids