Skip to content

Commit

Permalink
Fixed string concatenation and updated license.
Browse files Browse the repository at this point in the history
  • Loading branch information
DevReaper0 committed Feb 8, 2022
1 parent 4173be4 commit 6499009
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2021 DaRubyMiner360
Copyright (c) 2022 DaRubyMiner360

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Binary file not shown.
Binary file removed interpreter/env/builtin/__pycache__/time.cpython-38.pyc
Binary file not shown.
24 changes: 12 additions & 12 deletions std/types/str.para
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ let Str = Array.extend({
return 0;
}

return __intern_default_compare__(self, other);
return __intern_default_compare__(self._value, other._value);
}

func to_str(self) {
Expand All @@ -39,19 +39,19 @@ let Str = Array.extend({
}

func replace(self, old, new, count=1) {
return __intern_str_replace__(self, old, new, count);
return __intern_str_replace__(self._value, old._value, new._value, count);
}

func tolower(self) {
return __intern_str_tolower__(self);
return __intern_str_tolower__(self._value);
}

func toupper(self) {
return __intern_str_toupper__(self);
return __intern_str_toupper__(self._value);
}

func totitle(self) {
return __intern_str_totitle__(self);
return __intern_str_totitle__(self._value);
}

func __construct__(self, value) {
Expand All @@ -65,7 +65,7 @@ let Str = Array.extend({
}

func append(self, value) {
return __intern_str_append__(self, value.to_str());
return __intern_str_append__(self._value, value.to_str());
}

func to_int(self) {
Expand All @@ -84,13 +84,13 @@ let Str = Array.extend({
let index = 0;

// apply any unary negative
while self[index] == '-' {
while self._value[index] == '-' {
negative = !negative;
index += 1;
}

while index != len {
midx = smap.find(self[index]);
midx = smap.find(self._value[index]);
// .find returns -1 if value does not exist in array
if midx == -1 {
print("Error: Non-integer character in string");
Expand Down Expand Up @@ -120,13 +120,13 @@ let Str = Array.extend({
let index = 0;

// apply any unary negative
while self[index] == '-' {
while self._value[index] == '-' {
svalue += '-';
index += 1;
}

while index != len {
if self[index] == '.' {
if self._value[index] == '.' {
dvalue = self.replace(svalue + ".", "");
let div = "1";
let l = dvalue.len();
Expand All @@ -140,7 +140,7 @@ let Str = Array.extend({
index = len;
}
else {
svalue += self[index];
svalue += self._value[index];
index += 1;
}
}
Expand All @@ -154,7 +154,7 @@ let Str = Array.extend({
let newstr = "";
let index = self.len();
while index {
newstr = newstr.append(self[index-1]);
newstr = newstr.append(self._value[index-1]);
index -= 1;
}
return newstr;
Expand Down

0 comments on commit 6499009

Please sign in to comment.