Rename Skip_{Next|Prev}_Whitesapce
Rename Skip_Next_Whitespace to Skip_Whitespace, Skip_Prev_Whitespace
to Skip_Whitespace_Back.
Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/4ea023cb
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/4ea023cb
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/4ea023cb
Branch: refs/heads/master
Commit: 4ea023cb6faeafca6d0e89f9c9b211aa08552e9a
Parents: 2f6b239
Author: Nick Wellnhofer <[email protected]>
Authored: Sat Oct 24 15:38:01 2015 +0200
Committer: Nick Wellnhofer <[email protected]>
Committed: Wed Oct 28 16:10:35 2015 +0100
----------------------------------------------------------------------
runtime/core/Clownfish/String.c | 12 ++++++------
runtime/core/Clownfish/String.cfh | 4 ++--
runtime/core/Clownfish/Test/TestString.c | 16 ++++++++--------
runtime/go/clownfish/string_test.go | 6 +++---
4 files changed, 19 insertions(+), 19 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4ea023cb/runtime/core/Clownfish/String.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/String.c b/runtime/core/Clownfish/String.c
index 090bda6..dca2b46 100644
--- a/runtime/core/Clownfish/String.c
+++ b/runtime/core/Clownfish/String.c
@@ -433,12 +433,12 @@ S_memmem(String *self, const char *substring, size_t
size) {
String*
Str_Trim_IMP(String *self) {
StringIterator *top = STACK_ITER(self, 0);
- StrIter_Skip_Next_Whitespace(top);
+ StrIter_Skip_Whitespace(top);
StringIterator *tail = NULL;
if (top->byte_offset < self->size) {
tail = STACK_ITER(self, self->size);
- StrIter_Skip_Prev_Whitespace(tail);
+ StrIter_Skip_Whitespace_Back(tail);
}
return StrIter_substring((StringIterator*)top, (StringIterator*)tail);
@@ -447,14 +447,14 @@ Str_Trim_IMP(String *self) {
String*
Str_Trim_Top_IMP(String *self) {
StringIterator *top = STACK_ITER(self, 0);
- StrIter_Skip_Next_Whitespace(top);
+ StrIter_Skip_Whitespace(top);
return StrIter_substring((StringIterator*)top, NULL);
}
String*
Str_Trim_Tail_IMP(String *self) {
StringIterator *tail = STACK_ITER(self, self->size);
- StrIter_Skip_Prev_Whitespace(tail);
+ StrIter_Skip_Whitespace_Back(tail);
return StrIter_substring(NULL, (StringIterator*)tail);
}
@@ -771,7 +771,7 @@ StrIter_Recede_IMP(StringIterator *self, size_t num) {
}
size_t
-StrIter_Skip_Next_Whitespace_IMP(StringIterator *self) {
+StrIter_Skip_Whitespace_IMP(StringIterator *self) {
size_t num_skipped = 0;
size_t byte_offset = self->byte_offset;
int32_t code_point;
@@ -787,7 +787,7 @@ StrIter_Skip_Next_Whitespace_IMP(StringIterator *self) {
}
size_t
-StrIter_Skip_Prev_Whitespace_IMP(StringIterator *self) {
+StrIter_Skip_Whitespace_Back_IMP(StringIterator *self) {
size_t num_skipped = 0;
size_t byte_offset = self->byte_offset;
int32_t code_point;
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4ea023cb/runtime/core/Clownfish/String.cfh
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/String.cfh
b/runtime/core/Clownfish/String.cfh
index f675aff..530db6d 100644
--- a/runtime/core/Clownfish/String.cfh
+++ b/runtime/core/Clownfish/String.cfh
@@ -347,13 +347,13 @@ public final class Clownfish::StringIterator nickname
StrIter
* @return the number of code points skipped.
*/
public size_t
- Skip_Next_Whitespace(StringIterator *self);
+ Skip_Whitespace(StringIterator *self);
/** Skip whitespace backward.
* @return the number of code points skipped.
*/
public size_t
- Skip_Prev_Whitespace(StringIterator *self);
+ Skip_Whitespace_Back(StringIterator *self);
/** Test whether the content after the iterator starts with `prefix`.
*/
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4ea023cb/runtime/core/Clownfish/Test/TestString.c
----------------------------------------------------------------------
diff --git a/runtime/core/Clownfish/Test/TestString.c
b/runtime/core/Clownfish/Test/TestString.c
index 291aee8..3a11510 100644
--- a/runtime/core/Clownfish/Test/TestString.c
+++ b/runtime/core/Clownfish/Test/TestString.c
@@ -600,19 +600,19 @@ test_iterator_whitespace(TestBatchRunner *runner) {
{
StringIterator *iter = Str_Top(ws_smiley);
- TEST_INT_EQ(runner, StrIter_Skip_Next_Whitespace(iter), num_spaces,
- "Skip_Next_Whitespace");
- TEST_INT_EQ(runner, StrIter_Skip_Next_Whitespace(iter), 0,
- "Skip_Next_Whitespace without whitespace");
+ TEST_INT_EQ(runner, StrIter_Skip_Whitespace(iter), num_spaces,
+ "Skip_Whitespace");
+ TEST_INT_EQ(runner, StrIter_Skip_Whitespace(iter), 0,
+ "Skip_Whitespace without whitespace");
DECREF(iter);
}
{
StringIterator *iter = Str_Tail(ws_smiley);
- TEST_INT_EQ(runner, StrIter_Skip_Prev_Whitespace(iter), num_spaces,
- "Skip_Prev_Whitespace");
- TEST_INT_EQ(runner, StrIter_Skip_Prev_Whitespace(iter), 0,
- "Skip_Prev_Whitespace without whitespace");
+ TEST_INT_EQ(runner, StrIter_Skip_Whitespace_Back(iter), num_spaces,
+ "Skip_Whitespace_Back");
+ TEST_INT_EQ(runner, StrIter_Skip_Whitespace_Back(iter), 0,
+ "Skip_Whitespace_Back without whitespace");
DECREF(iter);
}
http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/4ea023cb/runtime/go/clownfish/string_test.go
----------------------------------------------------------------------
diff --git a/runtime/go/clownfish/string_test.go
b/runtime/go/clownfish/string_test.go
index fb67aae..cdfad20 100644
--- a/runtime/go/clownfish/string_test.go
+++ b/runtime/go/clownfish/string_test.go
@@ -310,14 +310,14 @@ func TestStrIterStartsWithEndsWith(t *testing.T) {
func TestStrIterSkipWhite(t *testing.T) {
iter := NewStringIterator(NewString("foo bar"), 0)
- if got := iter.SkipNextWhitespace(); got != 0 {
+ if got := iter.SkipWhitespace(); got != 0 {
t.Error("No whitespace to skip")
}
iter.Advance(3)
- if got := iter.SkipNextWhitespace(); got != 2 ||
!iter.StartsWith("bar") {
+ if got := iter.SkipWhitespace(); got != 2 || !iter.StartsWith("bar") {
t.Error("Skip forward 2 spaces")
}
- if got := iter.SkipPrevWhitespace(); got != 2 || !iter.EndsWith("foo") {
+ if got := iter.SkipWhitespaceBack(); got != 2 || !iter.EndsWith("foo") {
t.Error("Skip backwards 2 spaces")
}
}