Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mruby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
mruby
Commits
1efb1bba
Commit
1efb1bba
authored
Apr 04, 2013
by
Masaki Muranaka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use mrb_name_error() as possible.
parent
2f829ea0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
8 deletions
+8
-8
mrbgems/mruby-struct/src/struct.c
mrbgems/mruby-struct/src/struct.c
+5
-5
src/class.c
src/class.c
+1
-1
src/variable.c
src/variable.c
+2
-2
No files found.
mrbgems/mruby-struct/src/struct.c
View file @
1efb1bba
...
...
@@ -125,7 +125,7 @@ mrb_struct_getmember(mrb_state *mrb, mrb_value obj, mrb_sym id)
return
ptr
[
i
];
}
}
mrb_
raisef
(
mrb
,
E_NAME_ERROR
,
"%S is not struct member"
,
mrb_sym2str
(
mrb
,
id
));
mrb_
name_error
(
mrb
,
id
,
"%S is not struct member"
,
mrb_sym2str
(
mrb
,
id
));
return
mrb_nil_value
();
/* not reached */
}
...
...
@@ -204,7 +204,7 @@ mrb_struct_set(mrb_state *mrb, mrb_value obj, mrb_value val)
return
ptr
[
i
]
=
val
;
}
}
mrb_
raisef
(
mrb
,
E_NAME_ERROR
,
"`%S' is not a struct member"
,
mrb_
name_error
(
mrb
,
mid
,
"`%S' is not a struct member"
,
mrb_sym2str
(
mrb
,
mid
));
return
mrb_nil_value
();
/* not reached */
}
...
...
@@ -249,7 +249,7 @@ make_struct(mrb_state *mrb, mrb_value name, mrb_value members, struct RClass * k
name
=
mrb_str_to_str
(
mrb
,
name
);
id
=
mrb_to_id
(
mrb
,
name
);
if
(
!
mrb_is_const_id
(
id
))
{
mrb_
raisef
(
mrb
,
E_NAME_ERROR
,
"identifier %S needs to be constant"
,
name
);
mrb_
name_error
(
mrb
,
id
,
"identifier %S needs to be constant"
,
name
);
}
if
(
mrb_const_defined_at
(
mrb
,
klass
,
id
))
{
mrb_warn
(
"redefining constant Struct::%s"
,
mrb_string_value_ptr
(
mrb
,
name
));
...
...
@@ -544,7 +544,7 @@ mrb_struct_aref_id(mrb_state *mrb, mrb_value s, mrb_sym id)
return
ptr
[
i
];
}
}
mrb_
raisef
(
mrb
,
E_NAME_ERROR
,
"no member '%S' in struct"
,
mrb_sym2str
(
mrb
,
id
));
mrb_
name_error
(
mrb
,
id
,
"no member '%S' in struct"
,
mrb_sym2str
(
mrb
,
id
));
return
mrb_nil_value
();
/* not reached */
}
...
...
@@ -619,7 +619,7 @@ mrb_struct_aset_id(mrb_state *mrb, mrb_value s, mrb_sym id, mrb_value val)
return
val
;
}
}
mrb_
raisef
(
mrb
,
E_NAME_ERROR
,
"no member '%S' in struct"
,
mrb_sym2str
(
mrb
,
id
));
mrb_
name_error
(
mrb
,
id
,
"no member '%S' in struct"
,
mrb_sym2str
(
mrb
,
id
));
return
val
;
/* not reach */
}
...
...
src/class.c
View file @
1efb1bba
...
...
@@ -979,7 +979,7 @@ mrb_method_search(mrb_state *mrb, struct RClass* c, mrb_sym mid)
if
(
RSTRING_LEN
(
inspect
)
>
64
)
{
inspect
=
mrb_any_to_s
(
mrb
,
mrb_obj_value
(
c
));
}
mrb_
raisef
(
mrb
,
E_NAME_ERROR
,
"undefined method '%S' for class %S"
,
mrb_
name_error
(
mrb
,
mid
,
"undefined method '%S' for class %S"
,
mrb_sym2str
(
mrb
,
mid
),
inspect
);
}
return
m
;
...
...
src/variable.c
View file @
1efb1bba
...
...
@@ -691,7 +691,7 @@ mrb_mod_cv_get(mrb_state *mrb, struct RClass * c, mrb_sym sym)
}
c
=
c
->
super
;
}
mrb_
raisef
(
mrb
,
E_NAME_ERROR
,
"uninitialized class variable %S in %S"
,
mrb_
name_error
(
mrb
,
sym
,
"uninitialized class variable %S in %S"
,
mrb_sym2str
(
mrb
,
sym
),
cls
);
/* not reached */
return
mrb_nil_value
();
...
...
@@ -847,7 +847,7 @@ L_RETRY:
}
c
=
c
->
super
;
}
mrb_
raisef
(
mrb
,
E_NAME_ERROR
,
"uninitialized constant %S"
,
mrb_
name_error
(
mrb
,
sym
,
"uninitialized constant %S"
,
mrb_sym2str
(
mrb
,
sym
));
/* not reached */
return
mrb_nil_value
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment