From b01548e08803e80933d3c0f25110cb397980ee96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Sok=C3=B3=C5=82?= Date: Tue, 7 Jan 2025 12:04:14 +0000 Subject: [PATCH] Operator print tweak --- src/FinchLogic/nodes.jl | 2 +- src/scheduler/LogicCompiler.jl | 7 ++++++- test/test_scheduler.jl | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/FinchLogic/nodes.jl b/src/FinchLogic/nodes.jl index 946dcedea..d2dcda8b2 100644 --- a/src/FinchLogic/nodes.jl +++ b/src/FinchLogic/nodes.jl @@ -50,7 +50,7 @@ alias """ table(tns, idxs...) -Logical AST expression for a tensor object `val`, indexed by fields `idxs...`. +Logical AST expression for a tensor object `tns`, indexed by fields `idxs...`. """ table diff --git a/src/scheduler/LogicCompiler.jl b/src/scheduler/LogicCompiler.jl index de70b88b3..8477320e7 100644 --- a/src/scheduler/LogicCompiler.jl +++ b/src/scheduler/LogicCompiler.jl @@ -70,7 +70,12 @@ end function compile_logic_constant(node) if node.kind === immediate - node.val + val = node.val + if Base.isoperator(Symbol(val)) + Symbol(val) + else + val + end elseif node.kind === deferred :($(node.ex)::$(node.type)) else diff --git a/test/test_scheduler.jl b/test/test_scheduler.jl index 9ad15232f..5d7a739f3 100644 --- a/test/test_scheduler.jl +++ b/test/test_scheduler.jl @@ -31,4 +31,4 @@ @test result == expected end -end \ No newline at end of file +end