#1639 Confusing error report when variable error in a string.

tcolar Wed 7 Sep 2011

With code like this:

line := "alpha beta tango $value. "

I get a weird multi-line error report a few lines later.

Leading space in multi-line Str must be 72 spaces

The problem is the . after value of course (should be ${value}. ), but the error message given is weird.

brian Wed 7 Sep 2011

Promoted to ticket #1639 and assigned to brian

Yuri Strot Thu 8 Sep 2011

I think it will be very useful to allow . to end a sentence. There are three simple cases which can be easily recognized and cover most of the linguistic cases:

  • The dot is the last character: "Unknown value: $value."
  • The dot is followed by white space: "Unknown value: $value. Use $values instead."
  • Ellipsis: "Unknown value: $value... Try one of $values."

brian Thu 8 Sep 2011

Well we could do that, seems like a reasonable idea. But then again it would cause more ambiguity for IDE auto-completion. I think safer to keep it the way it is for now which is strict, then we could always go back and add special cases later.

Yuri Strot Thu 8 Sep 2011

I guess there is no need to change something in the current IDE behaviour. Let's say I put . after typing "Unknown value: $value and the next steps are ambiguous. Usually IDE shows completion tips here. If my dot means sentence ending I simply ignore these tips and push space or ending " or move cursor forward and completion will disappear. Moreover usually IDE shows auto-completion with some delay, so probably I will not see unnecessary tips at all. Looks like regular task for IDE: show possible completions which may or may not be right.

andy Thu 8 Sep 2011

Might be nice - tho think I lean towards current behavior - one simple rule to remember.

brian Mon 14 Nov 2011

Ticket resolved in 1.0.61

I fixed the compiler to be more strict, now the char immediately following a dotted interpolation such as $x. must be an actual identifier. Otherwise you get a more meaningful error. There was a bit of slop previously in that things like newlines, space, or numbers would result in non-specific errors.

Login or Signup to reply.