aboutsummaryrefslogtreecommitdiffstats
path: root/re.c
Commit message (Collapse)AuthorAgeFilesLines
* * re.c (Init_Regexp): new method Regexp#fixed_encoding?akr2007-11-261-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_fixed_encoding_p): extracted from rb_reg_prepare_re andakr2007-11-261-63/+48
| | | | | | | | rb_reg_s_union. (rb_reg_s_union): refactored. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/encoding.h (rb_enc_str_asciionly_p): declared.akr2007-11-251-19/+98
| | | | | | | | | | | | | | (rb_enc_str_asciicompat_p): defined. * re.c (rb_reg_initialize_str): use rb_enc_str_asciionly_p. (rb_reg_quote): return ascii-8bit string if the argument is ascii-only to generate encoding generic regexp if possible. (rb_reg_s_union): fix encoding handling. [ruby-dev:32094] * string.c (rb_enc_str_asciionly_p): defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14013 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (REG_CASESTATE): unused macro removed.akr2007-11-231-9/+19
| | | | | | | | | | | | (rb_reg_prepare_re): check encoding difference. (rb_reg_initialize): check 8bit byte. * parse.y (parser_tokadd_escape): fix has8bit. [ruby-dev:32113] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (match_begin): should return offset by character.matz2007-11-231-12/+22
| | | | | | | | | | [ruby-dev:32331] * re.c (match_end): ditto. * re.c (rb_reg_search): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_quote): quote \v as well.akr2007-11-041-1/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_initialize_m): use StringValuePtr instead ofakr2007-11-041-1/+1
| | | | | | | StringValueCStr because \0 exists when Regexp.new("\0"). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_regx_options, reg_compile_gen): relaxened encodingnobu2007-10-191-24/+32
| | | | | | | | | | | | | | matching rule. * re.c (rb_reg_initialize): always set encoding of Regexp. * re.c (rb_reg_initialize_str): fix enconding for non 7bit-clean strings. * re.c (rb_reg_initialize_m): use ascii encoding for 'n' option. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_s_union): the last check was not complete.matz2007-10-171-3/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13733 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_enc_from_encoding, rb_enc_register): associate indexnobu2007-10-171-3/+3
| | | | | | | | | | | | to self. * encoding.c (enc_capable): Encoding objects are encoding capable. * re.c (rb_reg_s_union): check if encoding matching by exact encoding objects. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_desc): set encoding.nobu2007-10-161-1/+2
| | | | | | | * re.c (rb_reg_s_union): check encodings. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_initialize_m): allow binary encoding option.nobu2007-10-161-1/+11
| | | | | | | [ruby-dev:32083] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_s_union): check for encoding of original object.nobu2007-10-161-3/+5
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (parser_regx_options): check if regexp encoding optionnobu2007-10-161-392/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | matches to current encoding. * re.c (char_to_option, rb_char_to_option_kcode): 'n' is not kcode option now. * re.c (rb_reg_to_s, rb_reg_error_desc): copy encoding rather than append as an option. * re.c (make_regexp, rb_reg_prepare_re): use encoding of Regexp and String instead of kcode. * re.c (rb_reg_initialize): set fixed option if none is set. * re.c (rb_reg_regcomp): ditto. * re.c (rb_reg_equal): check if encodings are equal. * re.c (rb_reg_initialize_m): encoding option is obsolete. * re.c (rb_kcode, rb_get_kcode, rb_set_kcode): removed. * re.c (Init_Regexp): removed Regexp#kcode method. * ruby.c (proc_options): allow long encoding name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_s_union): encoding of all regexp objects shouldmatz2007-10-161-0/+4
| | | | | | match. [ruby-dev:32076] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (match_values_at): make #select to be alias to #values_atmatz2007-10-121-41/+4
| | | | | | to adapt RDoc description. [ruby-core:12588] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_s_quote): no longer takes optional second argumentmatz2007-10-101-19/+6
| | | | | | that has never been documented. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix rdoc position of Regexp.union.akr2007-10-081-17/+17
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* add an example for Regexp.union document.akr2007-10-061-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13642 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * insns.def (opt_eq): get rid of gcc bug.nobu2007-10-061-0/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/defines.h: no longer provide DEFAULT_KCODE.matz2007-10-051-9/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_s_union_m): Regexp.union accepts single argument whichakr2007-10-051-8/+22
| | | | | | | is an array of patterns. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* replace rb_memcicmp()matz2007-10-041-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13624 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert rb_memcmp() change to pacify GCC optimizermatz2007-10-041-5/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_memcmp): no longer useful without ruby_ignorecase.matz2007-10-041-6/+5
| | | | | | * re.c (rb_reg_prepare_re): revert recompile condition. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (kcode_setter): restore erroneously removed setter.matz2007-10-041-1/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13621 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (ignorecase_setter): change warning message.matz2007-10-041-1/+2
| | | | | | | | * re.c (ignorecase_getter): now gives warning. * string.c (rb_str_cmp_m): update RDoc document. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13620 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (Init_Regexp): remove obsolete const alias: MatchingData.matz2007-10-041-1/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (kcode_setter): Perl-ish global variable `$=' no longermatz2007-10-041-58/+15
| | | | | | effective. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c (rb_obj_encoding): returns encoding of the given object.nobu2007-10-041-0/+1
| | | | | | | | | * re.c (Init_Regexp): new method Regexp#encoding. * string.c (str_encoding): moved to encoding.c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (Init_Regexp): test DEFAULT_KCODE in C code becauseakr2007-09-291-13/+8
| | | | | | | KCODE_EUC, etc are enum. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13571 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_match_m): evaluate a block if match. it would makematz2007-09-201-0/+16
| | | | | | | | condition statement much shorter, if no else clause is needed. * string.c (rb_str_match_m): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_cycle): typo in rdoc. a patch from Yuguimatz2007-09-061-13/+13
| | | | | | <yugui@yugui.sakura.ne.jp>. [ruby-dev:31748] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (str_gsub): should not use mbclen2() which has broken API.matz2007-08-291-8/+0
| | | | | | * re.c: remove rb_reg_mbclen2(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_mbclen2): suppress a warning.nobu2007-08-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c (rb_str_subseq): retrieve substring based on byte offset.matz2007-08-281-5/+5
| | | | | | | * string.c (rb_str_rindex_m): was confusing character offset and byte offset. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y, re.c: re-applied revision 13092.nobu2007-08-251-15/+22
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * encoding.c: provide basic features for M17N.matz2007-08-251-67/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * parse.y: encoding aware parsing. * parse.y (pragma_encoding): encoding specification pragma. * parse.y (rb_intern3): encoding specified symbols. * string.c (rb_str_length): length based on characters. for older behavior, bytesize method added. * string.c (rb_str_index_m): index based on characters. rindex as well. * string.c (succ_char): encoding aware succeeding string. * string.c (rb_str_reverse): reverse based on characters. * string.c (rb_str_inspect): encoding aware string description. * string.c (rb_str_upcase_bang): encoding aware case conversion. downcase, capitalize, swapcase as well. * string.c (rb_str_tr_bang): tr based on characters. delete, squeeze, tr_s, count as well. * string.c (rb_str_split_m): split based on characters. * string.c (rb_str_each_line): encoding aware each_line. * string.c (rb_str_each_char): added. iteration based on characters. * string.c (rb_str_strip_bang): encoding aware whitespace stripping. lstrip, rstrip as well. * string.c (rb_str_justify): encoding aware justifying (ljust, rjust, center). * string.c (str_encoding): get encoding attribute from a string. * re.c (rb_reg_initialize): encoding aware regular expression * sprintf.c (rb_str_format): formatting (i.e. length count) based on characters. * io.c (rb_io_getc): getc to return one-character string. for older behavior, getbyte method added. * ext/stringio/stringio.c (strio_getc): ditto. * io.c (rb_io_ungetc): allow pushing arbitrary string at the current reading point. * ext/stringio/stringio.c (strio_ungetc): ditto. * ext/strscan/strscan.c: encoding support. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_s_try_convert): more document description.matz2007-08-251-2/+2
| | | | | | * re.c (rb_reg_s_try_convert): typo fixed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_s_try_convert): a new class method to convertmatz2007-08-241-0/+17
| | | | | | | | | | | | | | | object or nil if it's not target-type. this mechanism is used to convert types in the C implemented methods. * hash.c (rb_hash_s_try_convert): ditto. * io.c (rb_io_s_try_convert): ditto. * re.c (rb_reg_s_try_convert): ditto. * string.c (rb_str_s_try_convert): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (reg_compile_gen): obtain error info from errinfo.nobu2007-08-181-15/+24
| | | | | | | | | * re.c (rb_reg_error_desc): make RegexpError for initialization error. * re.c (rb_reg_compile): return nil and set errinfo if error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (option_to_str, arg_kcode, opt_kcode): options conversionnobu2007-08-021-46/+65
| | | | | | | | | | between int and string. * re.c (rb_reg_compile): append regexp options to error message. [ruby-dev:31334] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y (reg_compile_gen): set error if failed to compile regexpnobu2007-08-021-3/+3
| | | | | | | | | | | literal. [ruby-dev:31336] * re.c (rb_reg_compile): should not use regexp which could not get initialized. [ruby-dev:31333] return error message to let the parser know it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/{intern,ruby}.h, compile.[ch], error.c, eval.c,nobu2007-07-051-27/+43
| | | | | | | | | eval_load.c, gc.c, iseq.c, main.c, parse.y, re.c, ruby.c, yarvcore.[ch] (ruby_eval_tree, ruby_sourcefile, ruby_sourceline, ruby_nerrs): purge global variables. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* update document to follow MatchData#inspect implementation.akr2007-06-231-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (match_inspect): MatchData#inspect implemented.akr2007-06-231-1/+25
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby: moved public headers.nobu2007-06-101-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * compile.c, dir.c, eval.c, eval_jump.h, eval_method.h, numeric.c,nobu2007-06-051-142/+145
| | | | | | | | pack.c, parse.y, re.c, thread.c, vm.c, vm_dump.c, call_cfunc.ci, thread_pthread.ci, thread_win32.ci: fixed indentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12431 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * oniguruma.h: updated to Oniguruma 5.7.0.matz2007-05-231-2/+2
| | | | | | * regsyntax.c, unicode.c: new files along with Oniguruma 5.x. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (reg_operand): allow symbols to be operands for regularmatz2007-02-141-9/+22
| | | | | | | | | | | expression matches. * string.c (Init_String): allow Symbol#===. * lib/date/format.rb (Date::Format::Bag::to_hash): string added prefixes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e