The regex is actually more complex than that. \x must be followed by 2 hex
digits, \u by 4 and \U by 8. But I agree in principle that restricting the
syntax of strings is the right thing to do.
On Apr 24, 2014 12:33 PM, "Radu Mereuta" <notifications@github.com> wrote:

> In src/javasources/KTool/src/org/kframework/kil/Token.java:
>
> > @@ -50,7 +50,7 @@ public static KApp kAppOf(String sort, String value) {
> >          } else if (sort.equals(IntBuiltin.SORT_NAME)) {
> >              return IntBuiltin.kAppOf(value);
> >          } else if (sort.equals(StringBuiltin.SORT_NAME)) {
> > -            return StringBuiltin.kAppOf(value);
> > +            return StringBuiltin.kAppOf(StringUtil.unquoteString(value));
>
> Then I should restrict the String lexicals to only parse things that are
> supported by the backends.
> This way they get a nice error message from the parser, instead getting
> bugs at runtime like Daejun had a few weeks ago.
> I was thinking of the following regex:
> Token{"\"" ((~[\"\n\r\])|([\][nrtfxuU\"]))* "\""}
>
> Anyone against this?
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/kframework/k/pull/397/files#r11960551>
> .
>