From 6f8bc6ebaabd62392f46e2dac4487b586caaaa01 Mon Sep 17 00:00:00 2001 From: mrredo <74524695+mrredo@users.noreply.github.com> Date: Fri, 28 Apr 2023 03:16:20 +0000 Subject: [PATCH] fixed an issue --- hello.rd | 6 ++++-- lexer/lexerArithmeticOperations.go | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hello.rd b/hello.rd index 5846848..34ddb84 100644 --- a/hello.rd +++ b/hello.rd @@ -1,2 +1,4 @@ -var bool = "false"; -println("" == bool) \ No newline at end of file +var bool = "true"; +if bool == "true" { + println(bool) +} \ No newline at end of file diff --git a/lexer/lexerArithmeticOperations.go b/lexer/lexerArithmeticOperations.go index ecdfdc8..b322ce5 100644 --- a/lexer/lexerArithmeticOperations.go +++ b/lexer/lexerArithmeticOperations.go @@ -157,7 +157,8 @@ loop: if curType == -1 { curType = ConvertToTokenType(reflect.TypeOf(va.Value).String()) } - if !(curType != ConvertToTokenType(reflect.TypeOf(fmt.Sprint(va.Value)).String()) && curType != c.Type) { + if (curType != ConvertToTokenType(reflect.TypeOf(fmt.Sprint(va.Value)).String()) && curType != c.Type) { + fmt.Println(curType, ConvertToTokenType(reflect.TypeOf(fmt.Sprint(va.Value)).String())) return "", c, err.NewTypeError(l.Scanner.Pos()) }