summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/lexer.c4
-rw-r--r--src/runner/runner.c7
-rw-r--r--test/main.felan8
3 files changed, 10 insertions, 9 deletions
diff --git a/src/compiler/lexer.c b/src/compiler/lexer.c
index 6263854..b75bd7e 100644
--- a/src/compiler/lexer.c
+++ b/src/compiler/lexer.c
@@ -86,8 +86,8 @@ const LexerToken LEXER_SYMBOL_TOKENS[] = {
LEXER_TOKEN_SYMBOL_EQUAL,
LEXER_TOKEN_SYMBOL_NOT_EQUAL,
LEXER_TOKEN_SYMBOL_GREATER,
- LEXER_TOKEN_SYMBOL_SMALLER,
LEXER_TOKEN_SYMBOL_GREATER_OR_EQUAL,
+ LEXER_TOKEN_SYMBOL_SMALLER,
LEXER_TOKEN_SYMBOL_SMALLER_OR_EQUAL,
};
const size_t LEXER_SYMBOL_SIZE =
@@ -314,12 +314,14 @@ bool isSymbol(char c) {
switch (c) {
case '-':
case '>':
+ case '<':
case '.':
case '+':
case '*':
case '/':
case '%':
case '=':
+ case '!':
return true;
default:
return false;
diff --git a/src/runner/runner.c b/src/runner/runner.c
index a1a1f44..81154f5 100644
--- a/src/runner/runner.c
+++ b/src/runner/runner.c
@@ -19,10 +19,8 @@
#define doLogicalOperation(op0, op1, operator, originalType, _type) \
{ \
- bool res = (bool)((_type)(originalType)(op0) \
- ->metadata \
- operator(_type)(originalType)(op1) \
- ->metadata); \
+ bool res = (bool)(((_type)(originalType)(op0)->metadata) operator( \
+ (_type)(originalType)(op1)->metadata)); \
astTreeDestroy(*(op0)); \
(op0)->metadata = (void *)(u64)res; \
(op0)->type = &AST_TREE_BOOL_TYPE; \
@@ -188,6 +186,7 @@ AstTree *runnerVariableGetValue(RunnerVariablePages *pages,
}
}
+ printError(variable->name_begin,variable->name_end,"Variable not found");
UNREACHABLE;
}
diff --git a/test/main.felan b/test/main.felan
index 1efa1cf..d8aec7a 100644
--- a/test/main.felan
+++ b/test/main.felan
@@ -1,12 +1,12 @@
main :: () -> void {
- a :getType(i64,u64)= 10;
- while a > 0 {
+ a :getType(i64,u64)= 0;
+ while a < 10 {
print_u64 a;
- a = a -1;
+ a = a + 1;
}
};
-signed :: false;
+signed := false;
getType :: (a:type,b:type)->type {
if signed