summaryrefslogtreecommitdiff
path: root/re.c
AgeCommit message (Collapse)Author
2008-01-25* include/ruby/intern.h (rb_str_buf_cat_ascii): declared.akr
* string.c (rb_str_buf_cat_ascii): defined. * re.c (rb_reg_s_union): use rb_str_buf_cat_ascii to support ASCII incompatible encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-24 * re.c (rb_reg_fixed_encoding_p): no need to treat ASCII-8BIT specially.usa
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-24 * re.c (rb_reg_initialize): 7bit clean regexp should be US-ASCII.usa
[ruby-dev:33346] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-23* re.c (rb_reg_prepare_re): fix SEGV byakr
/a/ =~ "aa".force_encoding("utf-16be"). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15178 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-18 * re.c (rb_char_to_option_kcode): Regexp switch `s' should meanusa
Windows-31J, as wells as `-Ks'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-17* re.c (rb_char_to_option_kcode): fixed typo.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-14* re.c (rb_char_to_option_kcode): use rb_enc_find_index() insteadmatz
of using fixed index value. * enc/Makefile.in (encsrcdir): make US-ASCII built-in. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-14* re.c (rb_reg_prepare_re): initialize error message buffer.akr
(rb_reg_search): ditto. (rb_reg_check_preprocess): ditto. (rb_reg_new_str): ditto. (rb_enc_reg_new): ditto. (rb_reg_compile): ditto. (rb_reg_initialize_m): ditto. (rb_reg_s_union_m): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-07* re.c (rb_reg_preprocess): fix fixed_enc condition.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-07* encoding.c (rb_enc_internal_get_index): extracted fromakr
rb_enc_get_index. (rb_enc_internal_set_index): extracted from rb_enc_associate_index * include/ruby/encoding.h (ENCODING_SET): work over ENCODING_INLINE_MAX. (ENCODING_GET): ditto. (ENCODING_IS_ASCII8BIT): defined. (ENCODING_CODERANGE_SET): defined. * re.c (rb_reg_fixed_encoding_p): use ENCODING_IS_ASCII8BIT. * string.c (rb_enc_str_buf_cat): use ENCODING_IS_ASCII8BIT. * parse.y (reg_fragment_setenc_gen): use ENCODING_IS_ASCII8BIT. * marshal.c (has_ivars): use ENCODING_IS_ASCII8BIT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06* re.c (rb_reg_initialize_str): forbid raw non ASCII characterakr
for ASCII-8BIT regexp in non ASCII-8BIT script. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06* include/ruby/encoding.h (rb_enc_str_buf_cat): declared.akr
* string.c (coderange_scan): extracted from rb_enc_str_coderange. (rb_enc_str_coderange): use coderange_scan. (rb_str_shared_replace): copy encoding and coderange. (rb_enc_str_buf_cat): new function for linear complexity string accumulation with encoding. (rb_str_sub_bang): don't conflict substituted part and replacement. (str_gsub): use rb_enc_str_buf_cat. (rb_str_clear): clear coderange. * re.c (rb_reg_regsub): use rb_enc_str_buf_cat. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-05* re.c (rb_reg_initialize_str): /\x80/n is not an error even if scriptakr
encoding is EUC-JP. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14899 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-04* include/ruby/intern.h, re.c (rb_reg_new): keep interface same asnobu
1.8. [ruby-core:14583] * include/ruby/intern.h, re.c (rb_reg_new_str): renamed, and defines HAVE_RB_REG_NEW_STR macro to tell if it is available. * include/ruby/encoding.h (rb_enc_reg_new): added. * insns.def (toregexp), marshal.c (r_object0): use rb_reg_new_str(). * re.c (rb_reg_regcomp, rb_reg_s_union): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-04* re.c (rb_reg_prepare_re): check string encoding. Oniguruma doesn'takr
support invalid encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-04unused variable removed.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-04* re.c (rb_reg_search): avoid inner loop for reverse search.matz
* regexec.c: unset USE_MATCH_RANGE_MUST_BE_INSIDE_OF_SPECIFIED_RANGE which is turned on since oniguruma 5.9.1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-03* re.c (rb_reg_search): iterate onig_match for reverse mode.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14876 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-31fix typos.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-29* re.c (rb_reg_regsub): returns the given string itself if nothingnobu
changed. * string.c (rb_str_sub_bang): keeps code-range as possible. * string.c (str_gsub): adjusts code-range. [ruby-core:14566] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-27* re.c (rb_reg_s_union): show encodings in error message.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-24* re.c (rb_reg_prepare_re): show regexp encoding in the error message.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-22* include/ruby/encoding.h, encoding.c, re.c, io.c, parse.y, numeric.c,akr
ruby.c, transcode.c: rename rb_ascii_encoding. to rb_ascii8bit_encoding. rb_ascii_encoding is ambiguous with ASCII-8BIT and US-ASCII. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-22refine error message.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* encoding.c (rb_ascii_encoding): renamed from previousmatz
rb_default_encoding(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14443 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* re.c (rb_reg_prepare_re): stop ENCODING_NONE warning if thematz
encoding of the str is ASCII-8BIT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* re.c (ARG_ENCODING_NONE): defined for /.../n option.akr
(REG_ENCODING_NONE): ditto. (rb_char_to_option_kcode): return ARG_ENCODING_NONE for n. (rb_reg_prepare_re): warn /ascii/n =~ "non-ascii". (rb_reg_initialize): set REG_ENCODING_NONE from ARG_ENCODING_NONE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* re.c (append_utf8): use rb_utf8_encoding() instead ofakr
rb_enc_find("utf-8"). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* test/ruby/test_system.rb (TestSystem::valid_syntax): applymatz
ASCII-8BIT encoding explicitly. * re.c (rb_reg_prepare_re): add encoding name in the message. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* re.c: change "character encodings differ" error messages.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-19* string.c (rb_str_rindex_m): too much adjustment.matz
* re.c (reg_match_pos): pos adjustment should be based on characters. * test/ruby/test_m17n.rb (TestM17N::test_str_insert): test updated to check negative offset behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-19* re.c (rb_reg_regsub): should set checked encoding.nobu
* string.c (rb_str_sub_bang): applied r14212 too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14333 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-18* parse.y (arg tMATCH arg): call reg_named_capture_assign_gen if regexpakr
literal is used. (reg_named_capture_assign_gen): assign the result of named capture into local variables. [ruby-dev:32588] * re.c: document the assignment by named captures. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-17* re.c (rb_reg_initialize): raise error if non-Unicode fixedmatz
encoding option is specified for regexp literals with \u{} escapes. * string.c (rb_str_squeeze_bang): should squeeze multibyte characters as well. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-17* string.c (scan_once): need no encoding compatibility check.matz
it's done inside of re_reg_seach(). * string.c (rb_str_split_m): ditto. * re.c (rb_reg_regsub): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-13* re.c (rb_reg_initialize): embedded string may override encodingmatz
of the regular expression. * re.c (rb_reg_initialize): fix encoding of regular expression if embedded string has its own encoding specified. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-13* encoding.c (rb_enc_compatible): encoding should never fall backmatz
to ASCII-8BIT unless both encodings are ASCII-8BIT. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-12* re.c, regerror.c, string.c, parse.y, ruby.c, file.c:akr
use capital letter for \xHH notation. [ruby-dev:32511] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-12* re.c (rb_reg_regsub): should copy encoding.nobu
* string.c (rb_str_sub_bang, str_gsub): should check and copy encoding to be replaced. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-11* encoding.c (rb_enc_ascget): renamed from rb_enc_get_ascii.akr
* include/ruby/encoding.h: follow the renaming. * re.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-11* encoding.c (rb_enc_get_ascii): add an argument to provide the akr
length of the returned character. * include/ruby/encoding.h (rb_enc_get_ascii): add the argument. * re.c (rb_reg_expr_str): modify rb_enc_get_ascii call. (rb_reg_quote): ditto. (rb_reg_regsub): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-10* re.c (rb_reg_match): should calculate offset by convertedmatz
operand. [ruby-cvs:21416] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14180 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-10* re.c (rb_reg_search): return byte offset. [ruby-dev:32452]nobu
* re.c (rb_reg_match, rb_reg_match2, rb_reg_match_m): convert byte offset to char index. * string.c (rb_str_index): return byte offset. [ruby-dev:32472] * string.c (rb_str_split_m): calculate in byte offset. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14171 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09* re.c (rb_reg_expr_str): use \xHH instead of \OOO.akr
* regerror.c (to_ascii): ditto. (onig_snprintf_with_pattern): ditto. (onig_snprintf_with_pattern): ditto. * string.c (rb_str_inspect): ditto. (rb_str_dump): ditto. * parse.y (parser_yylex): ditto. * ruby.c (proc_options): ditto. * file.c (rb_f_test): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09* re.c (rb_reg_names): new method Regexp#names.akr
(rb_reg_named_captures): new method Regexp#named_captures (match_regexp): new method MatchData#regexp. (match_names): new method MatchData#names. * lib/pp.rb (MatchData#pretty_print): show names of named captures. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09* re.c (rb_reg_s_last_match): accept named capture's name.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14161 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09Regexp#fixed_encoding? documented.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09document named capture of MatchData#{offset,begin,end,inspect}.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09* re.c (match_backref_number): new function for converting a backrefakr
name/number to an integer. (match_offset): use match_backref_number. (match_begin): ditto. (match_end): ditto. (name_to_backref_number): raise IndexError instead of RuntimeError. (match_inspect): show capture index. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14158 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-09* re.c (append_utf8): check unicode range.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14154 b2dd03c8-39d4-4d8f-98ff-823fe69b080e