|
1 | 1 | package sigma.compiler.ir |
2 | 2 |
|
3 | 3 | import org.ergoplatform._ |
4 | | -import sigma.ast.SType.tT |
5 | | -import sigma.{SigmaException, VersionContext, ast} |
6 | 4 | import sigma.Evaluation.stypeToRType |
| 5 | +import sigma.SigmaException |
| 6 | +import sigma.VersionContext |
| 7 | +import sigma.ast.{Ident, Select, Val} |
7 | 8 | import sigma.ast.SType.tT |
8 | | -import sigma.{SigmaException, VersionContext, ast} |
9 | 9 | import sigma.ast.TypeCodes.LastConstantCode |
10 | 10 | import sigma.ast.Value.Typed |
11 | 11 | import sigma.ast.syntax.{SValue, ValueOps} |
12 | 12 | import sigma.ast._ |
13 | 13 | import sigma.compiler.ir.core.MutableLazy |
14 | 14 | import sigma.crypto.EcPointType |
15 | | -import sigma.VersionContext |
16 | 15 | import sigma.data.ExactIntegral.{ByteIsExactIntegral, IntIsExactIntegral, LongIsExactIntegral, ShortIsExactIntegral} |
17 | 16 | import sigma.data.ExactOrdering.{ByteIsExactOrdering, IntIsExactOrdering, LongIsExactOrdering, ShortIsExactOrdering} |
18 | 17 | import sigma.data.{CSigmaDslBuilder, ExactIntegral, ExactNumeric, ExactOrdering, Lazy, Nullable} |
19 | | -import sigma.util.Extensions.ByteOps |
20 | | -import sigmastate.interpreter.Interpreter.ScriptEnv |
21 | | -import sigma.ast.{Ident, Select, Val} |
22 | 18 | import sigma.data.UnsignedBigIntNumericOps.{UnsignedBigIntIsExactIntegral, UnsignedBigIntIsExactOrdering} |
23 | 19 | import sigma.exceptions.GraphBuildingException |
24 | 20 | import sigma.serialization.OpCodes |
25 | | -import sigma.{SigmaException, ast} |
26 | | -import sigma.VersionContext |
| 21 | +import sigma.util.Extensions.ByteOps |
| 22 | +import sigmastate.interpreter.Interpreter.ScriptEnv |
27 | 23 |
|
28 | 24 | import scala.collection.mutable.ArrayBuffer |
29 | 25 |
|
@@ -514,10 +510,10 @@ trait GraphBuilding extends Base with DefRewriting { IR: IRContext => |
514 | 510 | case Ident(n, _) => |
515 | 511 | env.getOrElse(n, !!!(s"Variable $n not found in environment $env")) |
516 | 512 |
|
517 | | - case ast.Upcast(Constant(value, _), toTpe: SNumericType) => |
| 513 | + case sigma.ast.Upcast(Constant(value, _), toTpe: SNumericType) => |
518 | 514 | eval(mkConstant(toTpe.upcast(value.asInstanceOf[AnyVal]), toTpe)) |
519 | 515 |
|
520 | | - case ast.Downcast(Constant(value, _), toTpe: SNumericType) => |
| 516 | + case sigma.ast.Downcast(Constant(value, _), toTpe: SNumericType) => |
521 | 517 | eval(mkConstant(toTpe.downcast(value.asInstanceOf[AnyVal]), toTpe)) |
522 | 518 |
|
523 | 519 | // Rule: col.size --> SizeOf(col) |
@@ -740,7 +736,7 @@ trait GraphBuilding extends Base with DefRewriting { IR: IRContext => |
740 | 736 | val res = sigmaDslBuilder.sha256(inputV) |
741 | 737 | res |
742 | 738 |
|
743 | | - case ast.SizeOf(In(xs)) => |
| 739 | + case SizeOf(In(xs)) => |
744 | 740 | xs.elem.asInstanceOf[Any] match { |
745 | 741 | case _: CollElem[a,_] => |
746 | 742 | val xsV = asRep[Coll[a]](xs) |
@@ -934,11 +930,11 @@ trait GraphBuilding extends Base with DefRewriting { IR: IRContext => |
934 | 930 | val values = colBuilder.fromItems(vs: _*)(eAny) |
935 | 931 | values |
936 | 932 |
|
937 | | - case ast.Upcast(In(input), tpe) => |
| 933 | + case sigma.ast.Upcast(In(input), tpe) => |
938 | 934 | val elem = stypeToElem(tpe.asNumType) |
939 | 935 | upcast(input)(elem) |
940 | 936 |
|
941 | | - case ast.Downcast(In(input), tpe) => |
| 937 | + case sigma.ast.Downcast(In(input), tpe) => |
942 | 938 | val elem = stypeToElem(tpe.asNumType) |
943 | 939 | downcast(input)(elem) |
944 | 940 |
|
|
0 commit comments