progs/lexer/lexer.sc
changeset 742 b5b5583a3a08
parent 725 f345e89895f5
child 757 ea0be0662be0
equal deleted inserted replaced
741:e66bd5c563eb 742:b5b5583a3a08
    79   case STAR(r) => SEQ(der(c, r), STAR(r))
    79   case STAR(r) => SEQ(der(c, r), STAR(r))
    80   case RECD(_, r1) => der(c, r1)
    80   case RECD(_, r1) => der(c, r1)
    81 }
    81 }
    82 
    82 
    83 
    83 
    84 // extracts a string from value
    84 // extracts a string from a value
    85 def flatten(v: Val) : String = v match {
    85 def flatten(v: Val) : String = v match {
    86   case Empty => ""
    86   case Empty => ""
    87   case Chr(c) => c.toString
    87   case Chr(c) => c.toString
    88   case Left(v) => flatten(v)
    88   case Left(v) => flatten(v)
    89   case Right(v) => flatten(v)
    89   case Right(v) => flatten(v)