progs/while-compiler-arrays/compile_arrays.sc
changeset 757 b0ff6121cb9a
parent 747 448a7a78aa86
equal deleted inserted replaced
756:cb2918e02806 757:b0ff6121cb9a
    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 }