-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* common.mk, defs/id.def, template/id.c.tmpl: generate id.c as well as id.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
- Loading branch information
Showing
7 changed files
with
94 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,7 +56,7 @@ y.tab.c | |
/encdb.h | ||
/exts.mk | ||
/goruby | ||
/id.h | ||
/id.[ch] | ||
/largefile.h | ||
/lex.c | ||
/libruby*.* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
Wed Dec 5 02:36:10 2012 Nobuyoshi Nakada <[email protected]> | ||
|
||
* common.mk, defs/id.def, template/id.c.tmpl: generate id.c as well as id.h. | ||
|
||
Wed Dec 5 00:56:21 2012 KOSAKI Motohiro <[email protected]> | ||
|
||
* thread.c (rb_mutex_owned_p): new method that return current | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# -*- ruby -*- | ||
predefined = %[\ | ||
intern | ||
method_missing MethodMissing | ||
length | ||
size | ||
gets | ||
succ | ||
each | ||
lambda | ||
send | ||
__send__ | ||
initialize | ||
initialize_copy | ||
initialize_clone | ||
initialize_dup | ||
_ UScore | ||
"/*NULL*/" NULL | ||
empty? | ||
respond_to? Respond_to | ||
respond_to_missing? Respond_to_missing | ||
<IFUNC> | ||
<CFUNC> | ||
core#set_method_alias | ||
core#set_variable_alias | ||
core#undef_method | ||
core#define_method | ||
core#define_singleton_method | ||
core#set_postexe | ||
core#hash_from_ary | ||
core#hash_merge_ary | ||
core#hash_merge_ptr | ||
core#hash_merge_kwd | ||
] | ||
|
||
predefined_ids = {} | ||
preserved_ids = [] | ||
attr_ids = [] | ||
predefined.each_line do |line| | ||
next if /^#/ =~ line or (name, token = line.split; !name) | ||
token ||= name | ||
if /#/ =~ token | ||
token = "_#{token.gsub(/\W+/, '_')}" | ||
else | ||
token = token.sub(/\?/, 'P').sub(/\A[a-z]/) {$&.upcase} | ||
token.gsub!(/\W+/, "") | ||
end | ||
(/\A(?!\d)\w+\z/ =~ name ? attr_ids : preserved_ids) << token | ||
predefined_ids[token] = name | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
%# -*- c -*- | ||
/* DO NOT EDIT THIS FILE DIRECTLY */ | ||
/********************************************************************** | ||
id.c - | ||
$Author$ | ||
created at: Wed Dec 5 02:36:10 2012 | ||
Copyright (C) 2004-2007 Koichi Sasada | ||
**********************************************************************/ | ||
<% | ||
predefined_ids = nil | ||
defs = File.join(File.dirname(erb.filename), "../defs/id.def") | ||
eval(File.read(defs), binding, defs) | ||
%> | ||
static void | ||
Init_id(void) | ||
{ | ||
#undef rb_intern | ||
#define rb_intern(str) rb_intern_const(str) | ||
rb_encoding *enc = rb_usascii_encoding(); | ||
|
||
% predefined_ids.each_pair do |token, name| | ||
REGISTER_SYMID(id<%=token%>, "<%=name%>"); | ||
% end | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters