progs/while-compiler-arrays/compile_arrays.sc
changeset 757 ea0be0662be0
parent 747 077fc2e5412c
equal deleted inserted replaced
756:f7c7a75e0583 757:ea0be0662be0
    85 // environments for variables and indices
    85 // environments for variables and indices
    86 type Env = Map[String, Int]
    86 type Env = Map[String, Int]
    87 
    87 
    88 // convenient string interpolations 
    88 // convenient string interpolations 
    89 // for generating instructions and labels
    89 // for generating instructions and labels
    90 import scala.language.implicitConversions
       
    91 import scala.language.reflectiveCalls
       
    92 
    90 
    93 implicit def sring_inters(sc: StringContext) = new {
    91 implicit def sring_inters(sc: StringContext) = new {
    94     def i(args: Any*): String = "   " ++ sc.s(args:_*) ++ "\n"
    92     def i(args: Any*): String = "   " ++ sc.s(args:_*) ++ "\n"
    95     def l(args: Any*): String = sc.s(args:_*) ++ ":\n"
    93     def l(args: Any*): String = sc.s(args:_*) ++ ":\n"
    96 }
    94 }