Skip to content
This repository was archived by the owner on Nov 9, 2025. It is now read-only.

Commit 8912ae9

Browse files
update
1 parent ede9951 commit 8912ae9

13 files changed

Lines changed: 66 additions & 26 deletions

File tree

src/identifiers/end_loop.hpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,10 @@ void end_loop(vector<string>::iterator it, ifstream &file) {
1010
if (variables[loopVariableName.top()] == 0) {
1111
// Pop loop flag
1212
loopFlag.pop();
13-
break;
1413
}
15-
else {
16-
// Check if loop line is empty
17-
if (!loopLine.empty()) {
18-
// Seekg to loop line
19-
file.seekg(int(loopLine.top()) - 2);
20-
}
14+
else if (!loopLine.empty()) {
15+
// Seekg to loop line
16+
file.seekg(int(loopLine.top()) - 3);
2117
}
2218
}
2319
else {

src/identifiers/equal.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
void equal(vector<string>::iterator it, ifstream &file) {
66
string a = *(it + 1), b = *(it + 2), c = *(it + 3);
77
if (isInteger(b)) {
8-
variables[c] = (variables[a] == b);
8+
variables[c] = (variables[a] == atoi(b.c_str()));
99
}
1010
else if (isInteger(a)){
11-
variables[c] = (a == variables[b]);
11+
variables[c] = (atoi(a.c_str()) == variables[b]);
1212
}
1313
else {
1414
variables[c] = (variables[a] == variables[b]);

src/identifiers/equal_or_greater.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
void equal_or_greater(vector<string>::iterator it, ifstream &file) {
66
string a = *(it + 1), b = *(it + 2), c = *(it + 3);
77
if (isInteger(b)) {
8-
variables[c] = (variables[a] >= b);
8+
variables[c] = (variables[a] >= atoi(b.c_str()));
99
}
1010
else if (isInteger(a)){
11-
variables[c] = (a >= variables[b]);
11+
variables[c] = (atoi(a.c_str()) >= variables[b]);
1212
}
1313
else {
1414
variables[c] = (variables[a] >= variables[b]);

src/identifiers/equal_or_less.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
void equal_or_less(vector<string>::iterator it, ifstream &file) {
66
string a = *(it + 1), b = *(it + 2), c = *(it + 3);
77
if (isInteger(b)) {
8-
variables[c] = (variables[a] <= b);
8+
variables[c] = (variables[a] <= atoi(b.c_str()));
99
}
1010
else if (isInteger(a)){
11-
variables[c] = (a <= variables[b]);
11+
variables[c] = (atoi(a.c_str()) <= variables[b]);
1212
}
1313
else {
1414
variables[c] = (variables[a] <= variables[b]);

src/identifiers/greater.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
void _greater(vector<string>::iterator it, ifstream &file) {
66
string a = *(it + 1), b = *(it + 2), c = *(it + 3);
77
if (isInteger(b)) {
8-
variables[c] = (variables[a] > b);
8+
variables[c] = (variables[a] > atoi(b.c_str()));
99
}
1010
else if (isInteger(a)){
11-
variables[c] = (a > variables[b]);
11+
variables[c] = (atoi(a.c_str()) > variables[b]);
1212
}
1313
else {
1414
variables[c] = (variables[a] > variables[b]);

src/identifiers/identifiers.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
#include "output.hpp"
55
// Wrap
66
#include "wrap.hpp"
7-
// New
8-
#include "new.hpp"
97
// Set
108
#include "set.hpp"
119
// Input

src/identifiers/if.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* By lemonorangeapple
44
**/
55
void _if(vector<string>::iterator it, ifstream &file) {
6-
if (variables[*(it + 1)].value == 0) {
6+
if (variables[*(it + 1)] == 0) {
77
// Push false if the variable value is 0
88
ifFlag.push(false);
99
}

src/identifiers/input.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
void input(vector<string>::iterator it, ifstream &file) {
66
long double temp;
77
cin >> temp;
8-
variables[*(it + 1)].value = temp;
8+
variables[*(it + 1)] = temp;
99
}

src/identifiers/less.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
void _less(vector<string>::iterator it, ifstream &file) {
66
string a = *(it + 1), b = *(it + 2), c = *(it + 3);
77
if (isInteger(b)) {
8-
variables[c] = (variables[a] < b);
8+
variables[c] = (variables[a] < atoi(b.c_str()));
99
}
1010
else if (isInteger(a)){
11-
variables[c] = (a < variables[b]);
11+
variables[c] = (atoi(a.c_str()) < variables[b]);
1212
}
1313
else {
1414
variables[c] = (variables[a] < variables[b]);

src/identifiers/not.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
* By lemonorangeapple
44
**/
55
void _not(vector<string>::iterator it, ifstream &file) {
6-
string next = (*it + 1);
6+
string next = *(it + 1);
77
variables[next] = !(bool(variables[next]));
88
}

0 commit comments

Comments
 (0)