mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parse.y: no reduction with 1
* parse.y (parser_set_integer_literal): use rb_rational_raw1() for integral rational because no reduction is needed with 1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42350 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
4c00941411
commit
6660c5fb0c
2 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sat Aug 3 10:33:52 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* parse.y (parser_set_integer_literal): use rb_rational_raw1() for
|
||||||
|
integral rational because no reduction is needed with 1.
|
||||||
|
|
||||||
Sat Aug 3 09:46:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Sat Aug 3 09:46:07 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* ext/etc/etc.c (setup_passwd, setup_group): set proper encodings to
|
* ext/etc/etc.c (setup_passwd, setup_group): set proper encodings to
|
||||||
|
|
2
parse.y
2
parse.y
|
@ -6428,7 +6428,7 @@ parser_set_integer_literal(struct parser_params *parser, VALUE v, int suffix)
|
||||||
{
|
{
|
||||||
int type = tINTEGER;
|
int type = tINTEGER;
|
||||||
if (suffix & NUM_SUFFIX_R) {
|
if (suffix & NUM_SUFFIX_R) {
|
||||||
v = rb_rational_new(v, INT2FIX(1));
|
v = rb_rational_raw1(v);
|
||||||
type = tRATIONAL;
|
type = tRATIONAL;
|
||||||
}
|
}
|
||||||
return set_number_literal(v, type, suffix);
|
return set_number_literal(v, type, suffix);
|
||||||
|
|
Loading…
Reference in a new issue