summaryrefslogtreecommitdiff
path: root/re.c
AgeCommit message (Collapse)Author
2013-12-20* include/ruby/ruby.h: rename OBJ_WRITE and OBJ_WRITTEN intoko1
RB_OBJ_WRITE and RB_OBJ_WRITTEN. * array.c, class.c, compile.c, hash.c, internal.h, iseq.c, proc.c, process.c, re.c, string.c, variable.c, vm.c, vm_eval.c, vm_insnhelper.c, vm_insnhelper.h, vm_method.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44299 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-26* compile.c: Use rb_fstring() to de-duplicate string literals in code. ↵tmm1
[ruby-core:58599] [Bug #9159] [ruby-core:54405] * iseq.c (prepare_iseq_build): De-duplicate iseq labels and source locations. * re.c (rb_reg_initialize): Use rb_fstring() for regex string. * string.c (rb_fstring): Handle non-string and already-fstr arguments. * vm_eval.c (eval_string_with_cref): De-duplicate eval source filename. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-26* re.c: [DOC] arguments of Regexp::union receive #to_regexp [Bug #8205]zzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-09re.c: suppress warningnobu
* re.c (rb_memsearch): suppress parentheses warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-25* re.c (rb_reg_to_s): convert closing parenthes to the target encodingnaruse
if it is ASCII incompatible encoding. [ruby-core:56063] [Bug #8650] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42167 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-02re.c: use built-in encoding indexesnobu
* internal.h: add EUC-JP and Windows-31J. * re.c (rb_char_to_option_kcode): use built-in encoding indexes in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-24* compile.c (make_name_for_block): use PRIsVALUE in format stringcharliesome
instead of %s and RSTRING_PTR to protect objects from being garbage collected too soon * encoding.c (str_to_encindex): ditto * hash.c (rb_hash_fetch_m): ditto * io.c (rb_io_reopen): ditto * parse.y (reg_fragment_check_gen): ditto * parse.y (reg_compile_gen): ditto * parse.y (ripper_assert_Qundef): ditto * re.c (rb_reg_raise): ditto * ruby.c (set_option_encoding_once): ditto * vm_eval.c (rb_throw_obj): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21* include/ruby/ruby.h (OBJ_WRITE): cast to (VALUE *) for secondko1
parameter `slot'. You don't need to write a cast (VALUE *) any more. * class.c, compile.c, hash.c, iseq.c, proc.c, re.c, variable.c, vm.c, vm_method.c: remove cast expressions for OBJ_WRITE(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-21* include/ruby/ruby.h, re.c: support write barrier for T_REGEXP.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-11* doc/re.rdoc: Rename to doc/regexp.rdoczzak
* re.c: Update rdoc include for rename of file git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-13* *.c, parse.y, insns.def: use RARRAY_AREF/ASET macroko1
instead of using RARRAY_PTR(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40690 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-12* array.c: Document synonymous methods, by windwiny [GH-277]zzak
* bignum.c: ditto * complex.c: ditto * dir.c: ditto * encoding.c: ditto * enumerator.c: ditto * numeric.c: ditto * proc.c: ditto * re.c: ditto * string.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-02* re.c (rb_reg_to_s): suppress duplicated charclass warning.naruse
Regexp#to_s suppress extra its whole regexp options by calling onig_new with its source, but it doesn't call rb_reg_preprocess. Therefore its Unicode escapes (\u{XXXX}) are given as is, and it may cause duplicated charclass warning for example "[\u{33}]" (3 is duplicated) or "[\u{a}\u{b}]" (u is duplicated). [ruby-core:53649] [Bug #8151] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-24* string.c (rb_str_rpartition): revert r39903, and convert byte offsetnaruse
to char offset; the return value of rb_reg_search is byte offset, but other than it of rb_str_rpartition expects char offset. [Bug #8138] [ruby-dev:47183] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-29* re.c (reg_operand): Simplify and reuse error handling [Bug #7539]marcandre
* test/ruby/test_regexp.rb: Test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-13[rdoc] expalin kcode argument of Regexp.newnaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-29adjust stylenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38654 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-23* re.c (rb_reg_eqq): doc: #=== is not a synonym for #=~, added examplezzak
[ruby-dev:46746] [Bug #7571] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38567 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-22Apply performance improvement to short byte array search.knu
* re.c (rb_memsearch_ss): Apply performance improvement to short byte array search for platforms without memmem(3). [Feature #6311] [ruby-dev:45530] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-13* re.c (rb_memsearch_ss): performance improvement by using memmem(3) ifglass
possible. [ruby-dev:45530] [Feature #6311] * configure.in: check existence of memmem(3) and that it is not broken. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-08* re.c (rb_memsearch): performance improvement by using memchr().glass
[ruby-dev:45397] [Feature #6173] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-20* include/ruby/ruby.h: add C APIs.nari
VALUE rb_newobj_of(VALUE klass, VALUE flags) #define NEWOBJ_OF(obj,type,klass,flags) These allow to change a allocation strategy depending on klass or flags. * gc.c: ditto * array.c: use new C API. * bignum.c: ditto * class.c: ditto * complex.c: ditto * ext/socket/ancdata.c: ditto * ext/socket/option.c: ditto * hash.c: ditto * io.c: ditto * marshal.c: ditto * numeric.c: ditto * object.c: ditto * random.c: ditto * range.c: ditto * rational.c: ditto * re.c: ditto * string.c: ditto * struct.c: ditto [Feature #7177][Feature #7047] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-20* re.c (rb_reg_initialize_m): Forgot to update output for or'd-optionsdrbrain
example. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-20* re.c (rb_reg_initialize_m): Update example to show that regexpdrbrain
options use | an not || to avoid confusion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-24* re.c (rb_reg_s_last_match): Update $~ to reference Regexpdrbrain
documentation about "special global variables". [Bug #6723] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-05obj_init_copynobu
* object.c (rb_obj_init_copy): should check if trusted too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-23use RB_TYPE_P() instead of comparison of TYPE()nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-08* re.c (rb_reg_equal): Removed incorrect example for Regexp#== withdrbrain
"n" option. [ruby-talk - Bug #6415] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-13* encoding.c (rb_enc_codepoint_len): Use UNREACHABLE to avoid "controldrbrain
reaches end of non-void function" warnings. [ruby-trunk - Bug #6066] * re.c (name_to_backref_number): ditto. * object.c (rb_Float): ditto. * io.c (io_readpartial): ditto. * io.c (io_read_nonblock): ditto. * pack.c (rb_uv_to_utf8): ditto. * proc.c (rb_method_entry_arity): ditto. * vm_method.c (rb_f_notimplement): ditto. * struct.c (rb_struct_aset_id): ditto. * class.c (rb_scan_args): ditto. * process.c (rlimit_resource_type): ditto. * process.c (rlimit_resource_value): ditto. * process.c (p_uid_switch): ditto. * process.c (p_gid_switch): ditto. * ext/digest/digest.c (rb_digest_instance_update): ditto. * ext/digest/digest.c (rb_digest_instance_finish): ditto. * ext/digest/digest.c (rb_digest_instance_reset): ditto. * ext/digest/digest.c (rb_digest_instance_block_length): ditto. * ext/bigdecimal/bigdecimal.c (BigDecimalCmp): ditto. * ext/dl/handle.c (rb_dlhandle_close): ditto. * ext/tk/tcltklib.c (pending_exception_check0): ditto. * ext/tk/tcltklib.c (pending_exception_check1): ditto. * ext/tk/tcltklib.c (ip_cancel_eval_core): ditto. * ext/tk/tcltklib.c (lib_get_reltype_name): ditto. * ext/tk/tcltklib.c (create_dummy_encoding_for_tk_core): ditto. * ext/tk/tkutil/tkutil.c (tk_hash_kv): ditto. * ext/openssl/ossl_ssl.c (ossl_ssl_session_reused): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_dsa_verify_asn1): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_at_infinit): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_is_on_curve): ditto. * ext/fiddle/conversions.c (generic_to_value): ditto. * ext/socket/raddrinfo.c (rsock_io_socket_addrinfo): ditto. * ext/socket/socket.c (sock_s_getnameinfo): ditto. * ext/ripper/eventids2.c (ripper_token2eventid): ditto. * cont.c (return_fiber): ditto. * dmydln.c (dln_load): ditto. * vm_insnhelper.c (vm_search_normal_superclass): ditto. * bignum.c (big_fdiv): ditto. * marshal.c (r_symlink): ditto. * marshal.c (r_symbol): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35321 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14* include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]marcandre
* array.c: Use rb_check_arity / rb_error_arity * class.c: ditto * enumerator.c: ditto * eval.c: ditto * file.c: ditto * hash.c: ditto * numeric.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * re.c: ditto * signal.c: ditto * string.c: ditto * struct.c: ditto * transcode.c: ditto * vm_eval.c: ditto * vm_insnhelper.c: ditto & implementation of rb_error_arity * test/ruby/test_arity.rb: tests for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-08* gc.c (rb_objspace_free): global_List is allocated with xmalloc.naruse
patched by Sokolov Yura. https://github.com/ruby/ruby/pull/78 * dln_find.c: remove useless replacement of free. * ext/readline/readline.c (readline_attempted_completion_function): strings for readline must allocated with malloc. * process.c (run_exec_dup2): use free; see also r20950. * re.c (onig_new_with_source): use malloc for oniguruma. * vm.c (ruby_vm_destruct): use free for VMs. * vm.c (thread_free): use free for threads. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-20* re.c (rb_reg_initialize): fix indent.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-24* re.c (match_aref): Use <code> around indexing examples to preventdrbrain
hyperlinks. [ruby-talk:389396] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29* use RB_TYPE_P which is optimized for constant types, instead ofnobu
comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-29* re.c (rb_reg_match): fix rdoc of Regexp#=~.naruse
patched by Tsuyoshi Sawada. [Bug #4781] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-12 * re.c (Init_Regexp): Document option constants. Patch by Vincentdrbrain
Batts. [Ruby 1.9 - Bug #4677] * lib/uri/common.rb (module URI): Documentation for URI. Patch by Vincent Batts. [Ruby 1.9- Bug #4677] * lib/uri/ftp.rb (module URI): ditto * lib/uri/generic.rb (module URI): ditto * lib/uri/http.rb (module URI): ditto * lib/uri/https.rb (module URI): ditto * lib/uri/ldap.rb (module URI): ditto * lib/uri/ldaps.rb (module URI): ditto * lib/uri/mailto.rb (module URI): ditto * process.c (Init_process): Document Process constants. Patch by Vincent Batts. [Ruby 1.9- Bug #4677] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-02* re.c (Init_Regexp): added a constant for ARG_ENCODING_NONEtenderlove
[ruby-core:35054] * test/ruby/test_regexp.rb: corresponding test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-27 * re.c (rb_reg_raise): add GC guard to prevent intermediatekosaki
variable from GC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-29Sorry, commit miss of r30412.usa
* re.c (rb_reg_expr_str): need to escape if the coderage is invalid. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-27* re.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30403 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02Revert "* re.c (rb_reg_initialize): don't set US-ASCII to regexp"naruse
This reverts commit r30058. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-02* re.c (rb_reg_initialize): don't set US-ASCII to regexpnaruse
when parser make initially compile a regexp. Usually regexp are used for the same of its script encoding. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-26* re.c (rb_reg_initialize_str): should succeed the taint status fromusa
the origin. [ruby-core:33338] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-04* random.c (rand_init): remove useless assignment.naruse
* re.c (update_char_offset): remove unused variable. * re.c (read_escaped_byte): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-23* re.c (rb_reg_search): fix: 4th argument should be regexpnaruse
object. patched by shintaro kuwamoto [ruby-dev:41667] #3459 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-23* re.c (rb_reg_expr_str): fixed out-of-boundary access at invalidnobu
multibyte characters. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28728 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-22* re.c (rb_reg_expr_str): fix broken Regexp#inspect when itnaruse
is ASCII-8BIT and non-ASCII character. The length of character should be from original byte string. [ruby-core:31431] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-05* re.c (rb_reg_expr_str): ASCII incompatible stringsnaruse
must always escape or converted. * re.c (rb_reg_expr_str): use rb_str_buf_cat_escaped_char when resenc is given: for Regexp#inspect or error message. * re.c (rb_reg_desc): add 'n' for ENCODING_NONE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e