Skip to content

Commit

Permalink
fix: removed და and ან keywords; და is matched before დააბრუნე and it…
Browse files Browse the repository at this point in the history
… causes the syntax errors for დააბრუნე
  • Loading branch information
pgagnidze committed Jun 6, 2023
1 parent 609c9b8 commit 73e9621
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
6 changes: 2 additions & 4 deletions ena/compiler.lua
Expand Up @@ -22,8 +22,6 @@ local toName = {
[lop.not_] = "not",
[lop.and_] = "and",
[lop.or_] = "or",
[lop.and_geo] = "and",
[lop.or_geo] = "or"
}

local unaryToName = {
Expand Down Expand Up @@ -166,12 +164,12 @@ function Compiler:codeExpression(ast)
self:codeExpression(ast.size)
self:addCode("newArray")
elseif ast.tag == "binaryOp" then
if ast.op == lop.and_ or ast.op == lop.and_geo then
if ast.op == lop.and_ then
self:codeExpression(ast.firstChild)
local fixupSSAnd = self:addJump("jumpIfFalseJumpNoPop")
self:codeExpression(ast.secondChild)
self:fixupJump(fixupSSAnd)
elseif ast.op == lop.or_ or ast.op == lop.or_geo then
elseif ast.op == lop.or_ then
self:codeExpression(ast.firstChild)
local fixupSSOr = self:addJump("jumpIfTrueJumpNoPop")
self:codeExpression(ast.secondChild)
Expand Down
2 changes: 0 additions & 2 deletions ena/lang/literals.lua
Expand Up @@ -24,8 +24,6 @@ module.op.equal = "=="
module.op.notEqual = "!="
module.op.and_ = "&&"
module.op.or_ = "||"
module.op.and_geo = "და"
module.op.or_geo = "ან"

-- unary operators --
module.op.not_ = "!"
Expand Down
2 changes: 1 addition & 1 deletion ena/parser.lua
Expand Up @@ -139,7 +139,7 @@ tokens.op.unarySign = T(C(P(l.op.positive) + l.op.negate))
tokens.op.not_ = T(C(l.op.not_))
tokens.op.print = T(l.op.print)
tokens.op.exec = T(l.op.exec)
tokens.op.logical = T(C(l.op.and_) + C(l.op.or_) + C(l.op.and_geo) + C(l.op.or_geo))
tokens.op.logical = T(C(l.op.and_) + C(l.op.or_))

local op = tokens.op
local sep = tokens.sep
Expand Down

0 comments on commit 73e9621

Please sign in to comment.