Verified Commit 2e451344 authored by Camil Staps's avatar Camil Staps 🙂

Optimize printInstruction in the ABC optimiser (due to John)

parent 6f1403bb
Pipeline #43774 passed with stages
in 14 minutes and 13 seconds
......@@ -50,12 +50,12 @@ printInstruction{|PAIR|} fx fy (PAIR x y) = fx x +++ " " +++ fy y
printInstruction{|EITHER|} fl _ (LEFT x) = fl x
printInstruction{|EITHER|} _ fr (RIGHT x) = fr x
printInstruction{|OBJECT|} fx (OBJECT x) = fx x
printInstruction{|CONS of d|} fx (CONS x) = case d.gcd_name of
printInstruction{|CONS of {gcd_name}|} fx (CONS x) = case gcd_name of
"IIns" -> "\t" +++ fx x +++ "\n"
"Line" -> fx x +++ "\n"
"Annotation" -> fx x
"OtherAnnotation" -> "." +++ fx x +++ "\n"
instr -> (instr +++ " " +++ fx x +++ "\n"):=(0, first_char)
instr -> {instr +++. " " +++ fx x +++ "\n" & [0]=first_char}
with
first_char = case instr.[0] of
'I' -> '\t' // Instruction
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment