Skip to content

Commit

Permalink
remove redundant bsqrt
Browse files Browse the repository at this point in the history
  • Loading branch information
algoidurovic authored and algorandskiy committed Apr 7, 2022
1 parent 0e4ff3b commit 8de66da
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 0 additions & 2 deletions TealangLexer.l4
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ BUILTINFUNC
| BEQ
| BNE
| BMOD
| BSQRT
| BYTEOR
| BYTEAND
| BYTEXOR
Expand Down Expand Up @@ -364,7 +363,6 @@ BGE : 'bge' ;
BEQ : 'beq' ;
BNE : 'bne' ;
BMOD : 'bmod' ;
BSQRT : 'bsqrt' ;
BYTEOR : 'bor' ;
BYTEAND : 'band' ;
BYTEXOR : 'bxor' ;
Expand Down
2 changes: 1 addition & 1 deletion compiler/codegen.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (n *assignInnerTxnNode) Codegen(ostream io.Writer) {
}

func (n *arrayAssignInnerTxnNode) Codegen(ostream io.Writer) {
n.value.Codegen(ostream)
n.childrenNodes[0].Codegen(ostream)
fmt.Fprintf(ostream, "itxn_field %s\n", n.name)
}

Expand Down
8 changes: 4 additions & 4 deletions compiler/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -595,30 +595,30 @@ func (l *treeNodeListener) EnterInnerTxnArrayAssign(ctx *gen.InnerTxnArrayAssign
listener := newExprListener(l.ctx, node)
ctx.Expr().EnterRule(listener)
exprToPush := listener.getExpr()
node.value = exprToPush
exprToPushType, err := exprToPush.getType()
if err != nil {
reportError(
fmt.Sprintf("failed type resolution type: %s", err.Error()),
ctx.GetParser(), ctx.TXNARRAYFIELD().GetSymbol(), ctx.GetRuleContext(),
ctx.GetParser(), ctx.Expr().GetStart(), ctx.GetRuleContext(),
)
return
}
exprType, err := runtimeFieldTypeFromSpec("txn", field)
if err != nil {
reportError(
fmt.Sprintf("failed to retrieve type of field %s: %s", field, err.Error()),
ctx.GetParser(), ctx.TXNARRAYFIELD().GetSymbol(), ctx.GetRuleContext(),
ctx.GetParser(), ctx.Expr().GetStart(), ctx.GetRuleContext(),
)
return
}
if exprType != exprToPushType {
reportError(
fmt.Sprintf("incompatible types: (lhs) %s vs %s (expr)", exprType, exprToPushType),
ctx.GetParser(), ctx.TXNARRAYFIELD().GetSymbol(), ctx.GetRuleContext(),
ctx.GetParser(), ctx.Expr().GetStart(), ctx.GetRuleContext(),
)
return
}
node.append(exprToPush)
l.node = node
}

Expand Down

0 comments on commit 8de66da

Please sign in to comment.