def literal_sub(s, fexp, wi)

      case s
        when /^\$(?:variable|var|v):([^{}\s\$]+)$/
          fexp.lookup_variable($~[1])
        when /^\$([^{}:\s\$]+)$/, /^\$(?:field|fld|f):([^{}\s\$]+)$/
          Ruote.lookup(wi['fields'], $~[1])
        else
          s
      end
    end
def literal_sub(s, fexp, wi)

      case s
        when /^\$(?:variable|var|v):([^{}\s\$]+)$/
          fexp.lookup_variable($~[1])
        when /^\$([^{}:\s\$]+)$/, /^\$(?:field|fld|f):([^{}\s\$]+)$/
          Ruote.lookup(wi['fields'], $~[1])
        else
          s
      end
    end
If the final text is of the form "$f:x" or "$v:y" will lookup the
 x field or the y variable. If the lookup is successful (not nil) will
 return the value, not the text (the value.to_s).