modus icon indicating copy to clipboard operation
modus copied to clipboard

Need better error message when invalid escape sequence present

Open maowtm opened this issue 2 years ago • 1 comments

a :- run("aaaaa\1bbbbbb").

Results in

error: expected "\""
  ┌─ Modusfile:1:11
  │
1 │ a :- run("aaaaa\1bbbbbb").
  │ ----------^
  │ │    │   │ 
  │ │    │   in section "modus_const"
  │ │    in section "rule_body"
  │ in section "rule"

This become very unclear if the string is very long (like a multi-line run command)

maowtm avatar Mar 05 '22 00:03 maowtm

image

Now it points to the problematic escape char at least. I think we can still improve by printing the possible escape chars, so I'll leave this issue open for now.

thevirtuoso1973 avatar Mar 05 '22 17:03 thevirtuoso1973