Permalink
Browse files

Minimizing the differences between "release" and "longife" -- elimina…

…ting superfluous whitespace differences etc.
  • Loading branch information...
1 parent 6ce9bc5 commit 798a3a2b575f748276551e380eb33d6b1c49ae9f @szegedi szegedi committed Aug 18, 2010
Showing with 22 additions and 26 deletions.
  1. +3 −3 class.c
  2. +3 −3 eval.c
  3. +3 −4 node.h
  4. +10 −10 parse.y
  5. +2 −4 ruby.c
  6. +1 −2 version.h
View
@@ -843,7 +843,7 @@ rb_define_method(klass, name, func, argc)
int ex = NOEX_PUBLIC;
- rb_add_method(klass, id, NEW_CFUNC(func,argc), ex);
+ rb_add_method(klass, id, NEW_CFUNC(func, argc), ex);
}
void
@@ -853,7 +853,7 @@ rb_define_protected_method(klass, name, func, argc)
VALUE (*func)();
int argc;
{
- rb_add_method(klass, rb_intern(name), NEW_CFUNC(func,argc), NOEX_PROTECTED);
+ rb_add_method(klass, rb_intern(name), NEW_CFUNC(func, argc), NOEX_PROTECTED);
}
void
@@ -863,7 +863,7 @@ rb_define_private_method(klass, name, func, argc)
VALUE (*func)();
int argc;
{
- rb_add_method(klass, rb_intern(name), NEW_CFUNC(func,argc), NOEX_PRIVATE);
+ rb_add_method(klass, rb_intern(name), NEW_CFUNC(func, argc), NOEX_PRIVATE);
}
void
View
@@ -2245,8 +2245,8 @@ rb_alias(klass, name, def)
}
}
st_insert(RCLASS(klass)->m_tbl, name,
- (st_data_t)NEW_METHOD(NEW_FBODY(body, def, origin),
- NOEX_WITH_SAFE(orig->nd_noex)));
+ (st_data_t)NEW_METHOD(NEW_FBODY(body, def, origin),
+ NOEX_WITH_SAFE(orig->nd_noex)));
if (!ruby_running) return;
@@ -7128,7 +7128,7 @@ void
rb_load(fname, wrap)
VALUE fname;
int wrap;
-{
+{
VALUE tmp;
int state;
volatile int prohibit_int = rb_prohibit_interrupt;
View
@@ -240,7 +240,7 @@ extern NODE *ruby_top_cref;
#define NEW_CFUNC(f,c) NEW_NODE(NODE_CFUNC,f,c,0)
#define NEW_IFUNC(f,c) NEW_NODE(NODE_IFUNC,f,c,0)
#define NEW_RFUNC(b1,b2) NEW_SCOPE(block_append(b1,b2))
-#define NEW_SCOPE(b) NEW_NODE(NODE_SCOPE,local_tbl(),0,b)
+#define NEW_SCOPE(b) NEW_NODE(NODE_SCOPE,local_tbl(),0,(b))
#define NEW_BLOCK(a) NEW_NODE(NODE_BLOCK,a,0,0)
#define NEW_IF(c,t,e) NEW_NODE(NODE_IF,c,t,e)
#define NEW_UNLESS(c,t,e) NEW_IF(c,e,t)
@@ -292,13 +292,12 @@ extern NODE *ruby_top_cref;
#define NEW_MATCH2(n1,n2) NEW_NODE(NODE_MATCH2,n1,n2,0)
#define NEW_MATCH3(r,n2) NEW_NODE(NODE_MATCH3,r,n2,0)
#define NEW_LIT(l) NEW_NODE(NODE_LIT,l,0,0)
-#define NEW_LIT_LONGLIFE(l) NEW_NODE(NODE_LIT,l,0,0)
#define NEW_STR(s) NEW_NODE(NODE_STR,s,0,0)
#define NEW_DSTR(s) NEW_NODE(NODE_DSTR,s,1,0)
#define NEW_XSTR(s) NEW_NODE(NODE_XSTR,s,0,0)
#define NEW_DXSTR(s) NEW_NODE(NODE_DXSTR,s,0,0)
#define NEW_DSYM(s,l) NEW_NODE(NODE_DSYM,s,1,l)
-#define NEW_EVSTR(n) NEW_NODE(NODE_EVSTR,0,n,0)
+#define NEW_EVSTR(n) NEW_NODE(NODE_EVSTR,0,(n),0)
#define NEW_CALL(r,m,a) NEW_NODE(NODE_CALL,r,m,a)
#define NEW_FCALL(m,a) NEW_NODE(NODE_FCALL,0,m,a)
#define NEW_VCALL(m) NEW_NODE(NODE_VCALL,0,m,0)
@@ -315,7 +314,7 @@ extern NODE *ruby_top_cref;
#define NEW_ALIAS(n,o) NEW_NODE(NODE_ALIAS,n,o,0)
#define NEW_VALIAS(n,o) NEW_NODE(NODE_VALIAS,n,o,0)
#define NEW_UNDEF(i) NEW_NODE(NODE_UNDEF,0,i,0)
-#define NEW_CLASS(n,b,s) NEW_NODE(NODE_CLASS,n,NEW_SCOPE(b),s)
+#define NEW_CLASS(n,b,s) NEW_NODE(NODE_CLASS,n,NEW_SCOPE(b),(s))
#define NEW_SCLASS(r,b) NEW_NODE(NODE_SCLASS,r,NEW_SCOPE(b),0)
#define NEW_MODULE(n,b) NEW_NODE(NODE_MODULE,n,NEW_SCOPE(b),0)
#define NEW_COLON2(c,i) NEW_NODE(NODE_COLON2,c,i,0)
View
@@ -929,7 +929,7 @@ fsym : fname
fitem : fsym
{
- $$ = NEW_LIT_LONGLIFE(ID2SYM($1));
+ $$ = NEW_LIT(ID2SYM($1));
}
| dsym
;
@@ -2001,7 +2001,7 @@ opt_ensure : kENSURE compstmt
literal : numeric
| symbol
{
- $$ = NEW_LIT_LONGLIFE(ID2SYM($1));
+ $$ = NEW_LIT(ID2SYM($1));
}
| dsym
;
@@ -2060,7 +2060,7 @@ regexp : tREGEXP_BEG xstring_contents tREGEXP_END
int options = $3;
NODE *node = $2;
if (!node) {
- node = NEW_LIT_LONGLIFE(rb_reg_new("", 0, options & ~RE_OPTION_ONCE));
+ node = NEW_LIT(rb_reg_new("", 0, options & ~RE_OPTION_ONCE));
}
else switch (nd_type(node)) {
case NODE_STR:
@@ -3725,7 +3725,7 @@ yylex()
}
c &= 0xff;
lex_state = EXPR_END;
- yylval.node = NEW_LIT_LONGLIFE(INT2FIX(c));
+ yylval.node = NEW_LIT(INT2FIX(c));
return tINTEGER;
case '&':
@@ -3924,7 +3924,7 @@ yylex()
yyerror("numeric literal without digits");
}
else if (nondigit) goto trailing_uc;
- yylval.node = NEW_LIT_LONGLIFE(rb_cstr_to_inum(tok(), 2, Qfalse));
+ yylval.node = NEW_LIT(rb_cstr_to_inum(tok(), 2, Qfalse));
return tINTEGER;
}
if (c == 'd' || c == 'D') {
@@ -3948,7 +3948,7 @@ yylex()
yyerror("numeric literal without digits");
}
else if (nondigit) goto trailing_uc;
- yylval.node = NEW_LIT_LONGLIFE(rb_cstr_to_inum(tok(), 10, Qfalse));
+ yylval.node = NEW_LIT(rb_cstr_to_inum(tok(), 10, Qfalse));
return tINTEGER;
}
if (c == '_') {
@@ -3980,7 +3980,7 @@ yylex()
pushback(c);
tokfix();
if (nondigit) goto trailing_uc;
- yylval.node = NEW_LIT_LONGLIFE(rb_cstr_to_inum(tok(), 8, Qfalse));
+ yylval.node = NEW_LIT(rb_cstr_to_inum(tok(), 8, Qfalse));
return tINTEGER;
}
if (nondigit) {
@@ -3997,7 +3997,7 @@ yylex()
}
else {
pushback(c);
- yylval.node = NEW_LIT_LONGLIFE(INT2FIX(0));
+ yylval.node = NEW_LIT(INT2FIX(0));
return tINTEGER;
}
}
@@ -4076,7 +4076,7 @@ yylex()
rb_warn("Float %s out of range", tok());
errno = 0;
}
- yylval.node = NEW_LIT_LONGLIFE(rb_float_new(d));
+ yylval.node = NEW_LIT(rb_float_new(d));
return tFLOAT;
}
yylval.node = NEW_LIT(rb_cstr_to_inum(tok(), 10, Qfalse));
@@ -4948,7 +4948,7 @@ gettable(id)
return NEW_STR(rb_str_new2(ruby_sourcefile));
}
else if (id == k__LINE__) {
- return NEW_LIT_LONGLIFE(INT2FIX(ruby_sourceline));
+ return NEW_LIT(INT2FIX(ruby_sourceline));
}
else if (is_local_id(id)) {
if (dyna_in_block() && rb_dvar_defined(id)) return NEW_DVAR(id);
View
@@ -873,7 +873,7 @@ load_file(fname, script)
VALUE f;
int line_start = 1;
- if (!fname) rb_load_fail(fname);
+ if (!fname) rb_load_fail(fname);
if (strcmp(fname, "-") == 0) {
f = rb_stdin;
}
@@ -972,9 +972,7 @@ load_file(fname, script)
rb_io_ungetc(f, c);
}
require_libraries(); /* Why here? unnatural */
- if (NIL_P(c)) {
- return;
- }
+ if (NIL_P(c)) return;
}
rb_compile_file(fname, f, line_start);
if (script && ruby__end__seen) {
View
@@ -27,5 +27,4 @@ RUBY_EXTERN const char *ruby_copyright;
#define RUBY_BIRTH_DAY 24
#define RUBY_RELEASE_STR "patchlevel"
-#define RUBY_RELEASE_NUM RUBY_PATCHLEVEL
-
+#define RUBY_RELEASE_NUM RUBY_PATCHLEVEL

0 comments on commit 798a3a2

Please sign in to comment.