summaryrefslogtreecommitdiff
path: root/tool/mk_builtin_loader.rb
diff options
context:
space:
mode:
-rw-r--r--tool/mk_builtin_loader.rb26
1 files changed, 22 insertions, 4 deletions
@@ -6,6 +6,7 @@ require_relative 'ruby_vm/helpers/c_escape'
SUBLIBS = {}
REQUIRED = {}
def string_literal(lit, str = [])
while lit
@@ -25,6 +26,17 @@ def string_literal(lit, str = [])
end
end
def inline_text argc, arg1
raise "argc (#{argc}) of inline! should be 1" unless argc == 1
arg1 = string_literal(arg1)
@@ -32,6 +44,15 @@ def inline_text argc, arg1
arg1.join("").rstrip
end
def make_cfunc_name inlines, name, lineno
case name
when /\[\]/
@@ -138,10 +159,7 @@ def collect_builtin base, tree, name, bs, inlines, locals = nil
if /(.+)[\!\?]\z/ =~ func_name
case $1
when 'attr'
- text = inline_text(argc, args.first)
- if text != 'inline'
- raise "Only 'inline' is allowed to be annotated (but got: '#{text}')"
- end
break
when 'cstmt'
text = inline_text argc, args.first