1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
Commit graph

5 commits

Author SHA1 Message Date
nobu
62ec5eb018 parse.y: more token names
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66896 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2019-01-21 10:24:56 +00:00
nobu
2f57e80640 parse.y: parse precisely
* parse.y (parser_number_literal_suffix): return bit set of found
  suffixes.
* parse.y (parser_set_number_literal, parser_set_integer_literal):
  split from parser_number_literal_suffix to set yyvlal.
* parse.y (parser_yylex): parse rational number literal with decimal
  point precisely.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42332 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02 14:14:55 +00:00
charliesome
29c5a3b89c * parse.y (negate_lit): add T_RATIONAL and T_COMPLEX to the switch
statement, and call rb_bug() if an unknown type is passed to
  negate_lit(). [ruby-core:56316] [Bug #8717]

* bootstraptest/test_literal_suffix.rb (assert_equal): add test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42323 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-02 01:40:27 +00:00
mrkn
ae0181b7fe * bootstraptest/test_literal_suffix.rb: add two test cases to
examine that "1if true" and "1rescue nil" are recognized as 1.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-01 15:14:45 +00:00
mrkn
e06407cf7d * rational.c (rb_flt_rationalize_with_prec): new public C function
to rationalize a Float instance with a precision.

* rational.c (rb_flt_rationalize): new public C function to
 rationalize a Float instance.  A precision is calculated from
 the given float number.

* include/ruby/intern.h: Add rb_flt_rationalize_with_prec and
  rb_flt_rationalize.

* parse.y: implement number literal suffixes, 'r' and 'i'.
  [ruby-core:55096] [Feature #8430]

* bootstraptest/test_literal_suffix.rb: add tests for parser to scan
  number literals with the above tsuffixes.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-01 14:58:54 +00:00