Permalink
Browse files

Add in new experimental rindex_i_s_s and rindex_i_s_s_i opcodes, on r…

…equest from moritz++. These are experimental. This, and my previous commit, resolve #767
  • Loading branch information...
1 parent 8e05e44 commit 9136b04b6ce62cf637934580686823d4b903b7ba @Whiteknight Whiteknight committed May 8, 2012
Showing with 1,310 additions and 1,021 deletions.
  1. +8 −0 api.yaml
  2. +12 −0 include/parrot/oplib/core_ops.h
  3. +255 −243 include/parrot/oplib/ops.h
  4. +255 −243 include/parrot/opsenum.h
  5. +35 −35 runtime/parrot/library/distutils.pir
  6. +729 −500 src/ops/core_ops.c
  7. +16 −0 src/ops/string.ops
View
@@ -626,3 +626,11 @@
tags:
- experimental
ticket: 'https://github.com/parrot/parrot/issues/717'
+
+ name : 'rindex opcode'
+ note :
+ The new rindex_i_s_s and rindex_i_s_s_i opcodes are experimental. They
+ duplicate functionality found in the String PMC reverse_index method.
+ tags :
+ - experimental
+ ticket : 'https://github.com/parrot/parrot/issues/767'
@@ -891,6 +891,18 @@ op_lib_t *Parrot_DynOp_core_4_3_0(PARROT_INTERP, long init);
opcode_t * Parrot_index_i_sc_s_ic(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_index_i_s_sc_ic(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_index_i_sc_sc_ic(opcode_t *, PARROT_INTERP);
+ opcode_t * Parrot_rindex_i_s_s(opcode_t *, PARROT_INTERP);
+ opcode_t * Parrot_rindex_i_sc_s(opcode_t *, PARROT_INTERP);
+ opcode_t * Parrot_rindex_i_s_sc(opcode_t *, PARROT_INTERP);
+ opcode_t * Parrot_rindex_i_sc_sc(opcode_t *, PARROT_INTERP);
+ opcode_t * Parrot_rindex_i_s_s_i(opcode_t *, PARROT_INTERP);
+ opcode_t * Parrot_rindex_i_sc_s_i(opcode_t *, PARROT_INTERP);
+ opcode_t * Parrot_rindex_i_s_sc_i(opcode_t *, PARROT_INTERP);
+ opcode_t * Parrot_rindex_i_sc_sc_i(opcode_t *, PARROT_INTERP);
+ opcode_t * Parrot_rindex_i_s_s_ic(opcode_t *, PARROT_INTERP);
+ opcode_t * Parrot_rindex_i_sc_s_ic(opcode_t *, PARROT_INTERP);
+ opcode_t * Parrot_rindex_i_s_sc_ic(opcode_t *, PARROT_INTERP);
+ opcode_t * Parrot_rindex_i_sc_sc_ic(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_sprintf_s_s_p(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_sprintf_s_sc_p(opcode_t *, PARROT_INTERP);
opcode_t * Parrot_sprintf_p_p_p(opcode_t *, PARROT_INTERP);
View

Large diffs are not rendered by default.

Oops, something went wrong.
View

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -1326,7 +1326,7 @@ an array creates a PMC group
.local string src
src = shift $P1
.local string ext
- $I0 = rindex(src, '.')
+ $I0 = 'rindex'(src, '.')
ext = substr src, $I0
unless ext == '.pmc' goto L6
push pmcs, src
@@ -1339,7 +1339,7 @@ an array creates a PMC group
L7:
unless $P1 goto L8
src = shift $P1
- $I0 = rindex(src, '.')
+ $I0 = 'rindex'(src, '.')
ext = substr src, $I0
if ext == '.h' goto L7
$S0 = _mk_path_gen_dynpmc(src, obj)
@@ -1542,7 +1542,7 @@ an array creates a PMC group
.sub '_mk_path_gen_dynpmc' :anon
.param string src
.param string ext
- $I0 = rindex(src, '.')
+ $I0 = 'rindex'(src, '.')
$S0 = substr src, 0, $I0
$S0 .= ext
unless ext == '.h' goto L1
@@ -1937,7 +1937,7 @@ the value is the POD pathname, for example 'src/prog.pir'
.local string src
src = shift $P1
.local string ext
- $I0 = rindex(src, '.')
+ $I0 = 'rindex'(src, '.')
ext = substr src, $I0
if ext == '.h' goto L3
$S0 = _mk_path_gen_dynpmc(src, obj)
@@ -3843,51 +3843,51 @@ TEMPLATE
configure: configure-stamp
configure-stamp:
- dh_testdir
- touch configure-stamp
+ dh_testdir
+ touch configure-stamp
build: build-stamp
build-stamp: configure-stamp
- dh_testdir
- %s build
- touch $@
+ dh_testdir
+ %s build
+ touch $@
clean:
- dh_testdir
- dh_testroot
- rm -f build-stamp configure-stamp
- %s clean
- dh_clean
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+ %s clean
+ dh_clean
install: build
- dh_testdir
- dh_testroot
- dh_prep
- dh_installdirs
- %s --root $(CURDIR)/debian/tmp install
- dh_install --sourcedir=$(CURDIR)/debian/tmp --list-missing
+ dh_testdir
+ dh_testroot
+ dh_prep
+ dh_installdirs
+ %s --root $(CURDIR)/debian/tmp install
+ dh_install --sourcedir=$(CURDIR)/debian/tmp --list-missing
# Build architecture-independent files here.
binary-indep: install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
- dh_testdir
- dh_testroot
- dh_installchangelogs
- dh_installdocs
- dh_installexamples
- dh_installman
- dh_link
- dh_strip
- dh_compress
- dh_fixperms
- dh_installdeb
- dh_shlibdeps
- dh_gencontrol
- dh_md5sums
- dh_builddeb
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installexamples
+ dh_installman
+ dh_link
+ dh_strip
+ dh_compress
+ dh_fixperms
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure
Oops, something went wrong.

0 comments on commit 9136b04

Please sign in to comment.