summaryrefslogtreecommitdiffhomepage
path: root/src/parse.y
diff options
context:
space:
mode:
authorcubicdaiya <[email protected]>2014-03-01 03:31:45 +0900
committercubicdaiya <[email protected]>2014-03-01 03:31:45 +0900
commit67de10bfcb9d9ff21e1aa678aff8afa10446b7c4 (patch)
tree440782e0ae519f5d0f82a8e68b76274aa0bd84a3 /src/parse.y
parent9b65a0d5722c4f23a9b3390e4d9e4277a4881dea (diff)
downloadmruby-67de10bfcb9d9ff21e1aa678aff8afa10446b7c4.tar.gz
mruby-67de10bfcb9d9ff21e1aa678aff8afa10446b7c4.zip
use C style comments instead of C++ style comments
According to CONTRIBUTING.md, Don't use C++ style comments /* This is the prefered comment style */ Use C++ style comments only for temporary comment e.g. commenting out some code lines.
Diffstat (limited to 'src/parse.y')
-rw-r--r--src/parse.y162
1 files changed, 81 insertions, 81 deletions
diff --git a/src/parse.y b/src/parse.y
index f0e9369a9..43dfc57fc 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -207,7 +207,7 @@ parser_strdup(parser_state *p, const char *s)
#undef strdup
#define strdup(s) parser_strdup(p, s)
-// xxx -----------------------------
+/* xxx ----------------------------- */
static node*
local_switch(parser_state *p)
@@ -266,14 +266,14 @@ local_add(parser_state *p, mrb_sym sym)
}
}
-// (:scope (vars..) (prog...))
+/* (:scope (vars..) (prog...)) */
static node*
new_scope(parser_state *p, node *body)
{
return cons((node*)NODE_SCOPE, cons(p->locals->car, body));
}
-// (:begin prog...)
+/* (:begin prog...) */
static node*
new_begin(parser_state *p, node *body)
{
@@ -284,84 +284,84 @@ new_begin(parser_state *p, node *body)
#define newline_node(n) (n)
-// (:rescue body rescue else)
+/* (:rescue body rescue else) */
static node*
new_rescue(parser_state *p, node *body, node *resq, node *els)
{
return list4((node*)NODE_RESCUE, body, resq, els);
}
-// (:ensure body ensure)
+/* (:ensure body ensure) */
static node*
new_ensure(parser_state *p, node *a, node *b)
{
return cons((node*)NODE_ENSURE, cons(a, cons(0, b)));
}
-// (:nil)
+/* (:nil) */
static node*
new_nil(parser_state *p)
{
return list1((node*)NODE_NIL);
}
-// (:true)
+/* (:true) */
static node*
new_true(parser_state *p)
{
return list1((node*)NODE_TRUE);
}
-// (:false)
+/* (:false) */
static node*
new_false(parser_state *p)
{
return list1((node*)NODE_FALSE);
}
-// (:alias new old)
+/* (:alias new old) */
static node*
new_alias(parser_state *p, mrb_sym a, mrb_sym b)
{
return cons((node*)NODE_ALIAS, cons(nsym(a), nsym(b)));
}
-// (:if cond then else)
+/* (:if cond then else) */
static node*
new_if(parser_state *p, node *a, node *b, node *c)
{
return list4((node*)NODE_IF, a, b, c);
}
-// (:unless cond then else)
+/* (:unless cond then else) */
static node*
new_unless(parser_state *p, node *a, node *b, node *c)
{
return list4((node*)NODE_IF, a, c, b);
}
-// (:while cond body)
+/* (:while cond body) */
static node*
new_while(parser_state *p, node *a, node *b)
{
return cons((node*)NODE_WHILE, cons(a, b));
}
-// (:until cond body)
+/* (:until cond body) */
static node*
new_until(parser_state *p, node *a, node *b)
{
return cons((node*)NODE_UNTIL, cons(a, b));
}
-// (:for var obj body)
+/* (:for var obj body) */
static node*
new_for(parser_state *p, node *v, node *o, node *b)
{
return list4((node*)NODE_FOR, v, o, b);
}
-// (:case a ((when ...) body) ((when...) body))
+/* (:case a ((when ...) body) ((when...) body)) */
static node*
new_case(parser_state *p, node *a, node *b)
{
@@ -375,49 +375,49 @@ new_case(parser_state *p, node *a, node *b)
return n;
}
-// (:postexe a)
+/* (:postexe a) */
static node*
new_postexe(parser_state *p, node *a)
{
return cons((node*)NODE_POSTEXE, a);
}
-// (:self)
+/* (:self) */
static node*
new_self(parser_state *p)
{
return list1((node*)NODE_SELF);
}
-// (:call a b c)
+/* (:call a b c) */
static node*
new_call(parser_state *p, node *a, mrb_sym b, node *c)
{
return list4((node*)NODE_CALL, a, nsym(b), c);
}
-// (:fcall self mid args)
+/* (:fcall self mid args) */
static node*
new_fcall(parser_state *p, mrb_sym b, node *c)
{
return list4((node*)NODE_FCALL, new_self(p), nsym(b), c);
}
-// (:super . c)
+/* (:super . c) */
static node*
new_super(parser_state *p, node *c)
{
return cons((node*)NODE_SUPER, c);
}
-// (:zsuper)
+/* (:zsuper) */
static node*
new_zsuper(parser_state *p)
{
return list1((node*)NODE_ZSUPER);
}
-// (:yield . c)
+/* (:yield . c) */
static node*
new_yield(parser_state *p, node *c)
{
@@ -430,105 +430,105 @@ new_yield(parser_state *p, node *c)
return cons((node*)NODE_YIELD, 0);
}
-// (:return . c)
+/* (:return . c) */
static node*
new_return(parser_state *p, node *c)
{
return cons((node*)NODE_RETURN, c);
}
-// (:break . c)
+/* (:break . c) */
static node*
new_break(parser_state *p, node *c)
{
return cons((node*)NODE_BREAK, c);
}
-// (:next . c)
+/* (:next . c) */
static node*
new_next(parser_state *p, node *c)
{
return cons((node*)NODE_NEXT, c);
}
-// (:redo)
+/* (:redo) */
static node*
new_redo(parser_state *p)
{
return list1((node*)NODE_REDO);
}
-// (:retry)
+/* (:retry) */
static node*
new_retry(parser_state *p)
{
return list1((node*)NODE_RETRY);
}
-// (:dot2 a b)
+/* (:dot2 a b) */
static node*
new_dot2(parser_state *p, node *a, node *b)
{
return cons((node*)NODE_DOT2, cons(a, b));
}
-// (:dot3 a b)
+/* (:dot3 a b) */
static node*
new_dot3(parser_state *p, node *a, node *b)
{
return cons((node*)NODE_DOT3, cons(a, b));
}
-// (:colon2 b c)
+/* (:colon2 b c) */
static node*
new_colon2(parser_state *p, node *b, mrb_sym c)
{
return cons((node*)NODE_COLON2, cons(b, nsym(c)));
}
-// (:colon3 . c)
+/* (:colon3 . c) */
static node*
new_colon3(parser_state *p, mrb_sym c)
{
return cons((node*)NODE_COLON3, nsym(c));
}
-// (:and a b)
+/* (:and a b) */
static node*
new_and(parser_state *p, node *a, node *b)
{
return cons((node*)NODE_AND, cons(a, b));
}
-// (:or a b)
+/* (:or a b) */
static node*
new_or(parser_state *p, node *a, node *b)
{
return cons((node*)NODE_OR, cons(a, b));
}
-// (:array a...)
+/* (:array a...) */
static node*
new_array(parser_state *p, node *a)
{
return cons((node*)NODE_ARRAY, a);
}
-// (:splat . a)
+/* (:splat . a) */
static node*
new_splat(parser_state *p, node *a)
{
return cons((node*)NODE_SPLAT, a);
}
-// (:hash (k . v) (k . v)...)
+/* (:hash (k . v) (k . v)...) */
static node*
new_hash(parser_state *p, node *a)
{
return cons((node*)NODE_HASH, a);
}
-// (:sym . a)
+/* (:sym . a) */
static node*
new_sym(parser_state *p, mrb_sym sym)
{
@@ -544,96 +544,96 @@ new_strsym(parser_state *p, node* str)
return mrb_intern(p->mrb, s, len);
}
-// (:lvar . a)
+/* (:lvar . a) */
static node*
new_lvar(parser_state *p, mrb_sym sym)
{
return cons((node*)NODE_LVAR, nsym(sym));
}
-// (:gvar . a)
+/* (:gvar . a) */
static node*
new_gvar(parser_state *p, mrb_sym sym)
{
return cons((node*)NODE_GVAR, nsym(sym));
}
-// (:ivar . a)
+/* (:ivar . a) */
static node*
new_ivar(parser_state *p, mrb_sym sym)
{
return cons((node*)NODE_IVAR, nsym(sym));
}
-// (:cvar . a)
+/* (:cvar . a) */
static node*
new_cvar(parser_state *p, mrb_sym sym)
{
return cons((node*)NODE_CVAR, nsym(sym));
}
-// (:const . a)
+/* (:const . a) */
static node*
new_const(parser_state *p, mrb_sym sym)
{
return cons((node*)NODE_CONST, nsym(sym));
}
-// (:undef a...)
+/* (:undef a...) */
static node*
new_undef(parser_state *p, mrb_sym sym)
{
return list2((node*)NODE_UNDEF, nsym(sym));
}
-// (:class class super body)
+/* (:class class super body) */
static node*
new_class(parser_state *p, node *c, node *s, node *b)
{
return list4((node*)NODE_CLASS, c, s, cons(p->locals->car, b));
}
-// (:sclass obj body)
+/* (:sclass obj body) */
static node*
new_sclass(parser_state *p, node *o, node *b)
{
return list3((node*)NODE_SCLASS, o, cons(p->locals->car, b));
}
-// (:module module body)
+/* (:module module body) */
static node*
new_module(parser_state *p, node *m, node *b)
{
return list3((node*)NODE_MODULE, m, cons(p->locals->car, b));
}
-// (:def m lv (arg . body))
+/* (:def m lv (arg . body)) */
static node*
new_def(parser_state *p, mrb_sym m, node *a, node *b)
{
return list5((node*)NODE_DEF, nsym(m), p->locals->car, a, b);
}
-// (:sdef obj m lv (arg . body))
+/* (:sdef obj m lv (arg . body)) */
static node*
new_sdef(parser_state *p, node *o, mrb_sym m, node *a, node *b)
{
return list6((node*)NODE_SDEF, o, nsym(m), p->locals->car, a, b);
}
-// (:arg . sym)
+/* (:arg . sym) */
static node*
new_arg(parser_state *p, mrb_sym sym)
{
return cons((node*)NODE_ARG, nsym(sym));
}
-// (m o r m2 b)
-// m: (a b c)
-// o: ((a . e1) (b . e2))
-// r: a
-// m2: (a b c)
-// b: a
+/* (m o r m2 b) */
+/* m: (a b c) */
+/* o: ((a . e1) (b . e2)) */
+/* r: a */
+/* m2: (a b c) */
+/* b: a */
static node*
new_args(parser_state *p, node *m, node *opt, mrb_sym rest, node *m2, mrb_sym blk)
{
@@ -645,126 +645,126 @@ new_args(parser_state *p, node *m, node *opt, mrb_sym rest, node *m2, mrb_sym bl
return cons(m, n);
}
-// (:block_arg . a)
+/* (:block_arg . a) */
static node*
new_block_arg(parser_state *p, node *a)
{
return cons((node*)NODE_BLOCK_ARG, a);
}
-// (:block arg body)
+/* (:block arg body) */
static node*
new_block(parser_state *p, node *a, node *b)
{
return list4((node*)NODE_BLOCK, p->locals->car, a, b);
}
-// (:lambda arg body)
+/* (:lambda arg body) */
static node*
new_lambda(parser_state *p, node *a, node *b)
{
return list4((node*)NODE_LAMBDA, p->locals->car, a, b);
}
-// (:asgn lhs rhs)
+/* (:asgn lhs rhs) */
static node*
new_asgn(parser_state *p, node *a, node *b)
{
return cons((node*)NODE_ASGN, cons(a, b));
}
-// (:masgn mlhs=(pre rest post) mrhs)
+/* (:masgn mlhs=(pre rest post) mrhs) */
static node*
new_masgn(parser_state *p, node *a, node *b)
{
return cons((node*)NODE_MASGN, cons(a, b));
}
-// (:asgn lhs rhs)
+/* (:asgn lhs rhs) */
static node*
new_op_asgn(parser_state *p, node *a, mrb_sym op, node *b)
{
return list4((node*)NODE_OP_ASGN, a, nsym(op), b);
}
-// (:int . i)
+/* (:int . i) */
static node*
new_int(parser_state *p, const char *s, int base)
{
return list3((node*)NODE_INT, (node*)strdup(s), (node*)(intptr_t)base);
}
-// (:float . i)
+/* (:float . i) */
static node*
new_float(parser_state *p, const char *s)
{
return cons((node*)NODE_FLOAT, (node*)strdup(s));
}
-// (:str . (s . len))
+/* (:str . (s . len)) */
static node*
new_str(parser_state *p, const char *s, int len)
{
return cons((node*)NODE_STR, cons((node*)strndup(s, len), (node*)(intptr_t)len));
}
-// (:dstr . a)
+/* (:dstr . a) */
static node*
new_dstr(parser_state *p, node *a)
{
return cons((node*)NODE_DSTR, a);
}
-// (:str . (s . len))
+/* (:str . (s . len)) */
static node*
new_xstr(parser_state *p, const char *s, int len)
{
return cons((node*)NODE_XSTR, cons((node*)strndup(s, len), (node*)(intptr_t)len));
}
-// (:xstr . a)
+/* (:xstr . a) */
static node*
new_dxstr(parser_state *p, node *a)
{
return cons((node*)NODE_DXSTR, a);
}
-// (:dsym . a)
+/* (:dsym . a) */
static node*
new_dsym(parser_state *p, node *a)
{
return cons((node*)NODE_DSYM, new_dstr(p, a));
}
-// (:str . (a . a))
+/* (:str . (a . a)) */
static node*
new_regx(parser_state *p, const char *p1, const char* p2)
{
return cons((node*)NODE_REGX, cons((node*)p1, (node*)p2));
}
-// (:dregx . a)
+/* (:dregx . a) */
static node*
new_dregx(parser_state *p, node *a, node *b)
{
return cons((node*)NODE_DREGX, cons(a, b));
}
-// (:backref . n)
+/* (:backref . n) */
static node*
new_back_ref(parser_state *p, int n)
{
return cons((node*)NODE_BACK_REF, (node*)(intptr_t)n);
}
-// (:nthref . n)
+/* (:nthref . n) */
static node*
new_nth_ref(parser_state *p, int n)
{
return cons((node*)NODE_NTH_REF, (node*)(intptr_t)n);
}
-// (:heredoc . a)
+/* (:heredoc . a) */
static node*
new_heredoc(parser_state *p)
{
@@ -783,30 +783,30 @@ new_literal_delim(parser_state *p)
return cons((node*)NODE_LITERAL_DELIM, 0);
}
-// (:words . a)
+/* (:words . a) */
static node*
new_words(parser_state *p, node *a)
{
return cons((node*)NODE_WORDS, a);
}
-// (:symbols . a)
+/* (:symbols . a) */
static node*
new_symbols(parser_state *p, node *a)
{
return cons((node*)NODE_SYMBOLS, a);
}
-// xxx -----------------------------
+/* xxx ----------------------------- */
-// (:call a op)
+/* (:call a op) */
static node*
call_uni_op(parser_state *p, node *recv, char *m)
{
return new_call(p, recv, intern_cstr(m), 0);
}
-// (:call a op b)
+/* (:call a op b) */
static node*
call_bin_op(parser_state *p, node *recv, char *m, node *arg1)
{
@@ -979,7 +979,7 @@ heredoc_end(parser_state *p)
}
#define is_strterm_type(p,str_func) ((int)(intptr_t)((p)->lex_strterm->car) & (str_func))
-// xxx -----------------------------
+/* xxx ----------------------------- */
%}
@@ -3432,7 +3432,7 @@ skips(parser_state *p, const char *s)
int c;
for (;;) {
- // skip until first char
+ /* skip until first char */
for (;;) {
c = nextc(p);
if (c < 0) return c;
@@ -4228,7 +4228,7 @@ parser_yylex(parser_state *p)
return '?';
}
token_column = newtok(p);
- // need support UTF-8 if configured
+ /* need support UTF-8 if configured */
if ((isalnum(c) || c == '_')) {
int c2 = nextc(p);
pushback(p, c2);