Added prefix increment and decrement. Debugging: off
This commit is contained in:
@@ -107,6 +107,18 @@ P1 &subtractsequal(P1 &p1, const P2 &p2)
|
|||||||
return (p1 -= p2);
|
return (p1 -= p2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename P1>
|
||||||
|
P1 &prefixincrement(P1 &p1)
|
||||||
|
{
|
||||||
|
return (++p1);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename P1>
|
||||||
|
P1 &prefixdecrement(P1 &p1)
|
||||||
|
{
|
||||||
|
return (--p1);
|
||||||
|
}
|
||||||
|
|
||||||
//Add canonical forms of operators
|
//Add canonical forms of operators
|
||||||
template<typename T>
|
template<typename T>
|
||||||
void add_oper_equals(BoxedCPP_System &s)
|
void add_oper_equals(BoxedCPP_System &s)
|
||||||
@@ -210,6 +222,8 @@ void add_opers_arithmetic_overload(BoxedCPP_System &s)
|
|||||||
register_function(s, ÷sequal<T, R>, "/=");
|
register_function(s, ÷sequal<T, R>, "/=");
|
||||||
register_function(s, &subtractsequal<T, R>, "-=");
|
register_function(s, &subtractsequal<T, R>, "-=");
|
||||||
register_function(s, &addsequal<T, R>, "+=");
|
register_function(s, &addsequal<T, R>, "+=");
|
||||||
|
register_function(s, &prefixincrement<T>, "++");
|
||||||
|
register_function(s, &prefixdecrement<T>, "--");
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename T>
|
template<typename T>
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
for (var i = 0; i < 10; i += 1) {
|
for (var i = 0; i < 10; ++i) {
|
||||||
print(i)
|
print(i)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -8,6 +8,6 @@ for (i = 10; i >= 0; i -= 2) {
|
|||||||
|
|
||||||
i = 0
|
i = 0
|
||||||
|
|
||||||
for (; i < 5; i += 1) {
|
for (; i < 5; ++i) {
|
||||||
print(i)
|
print(i)
|
||||||
}
|
}
|
||||||
|
@@ -554,7 +554,7 @@ TokenPtr parse(Rule &rule, std::vector<TokenPtr> &tokens, const char *filename)
|
|||||||
std::pair<Token_Iterator, bool> results = rule(iter, end, parent);
|
std::pair<Token_Iterator, bool> results = rule(iter, end, parent);
|
||||||
|
|
||||||
if (results.second) {
|
if (results.second) {
|
||||||
debug_print(parent, "");
|
//debug_print(parent, "");
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Reference in New Issue
Block a user