If I write this function:
multiLineText : Text
multiLineText =
use Text ++
"this is the first line" ++
"this is the second line" ++
"this is the third line" ++
"this is the fourth line"
It will parse and typecheck just fine. If I add it to my codebase, then view it back out, ucm shows it to me like this:
.> view multiLineText
multiLineText : Text
multiLineText =
use Text ++
"this is the first line"
++ "this is the second line"
++ "this is the third line"
++ "this is the fourth line"
The ++ operators have been moved to the beginning of the lines. I get the exact same representation if I edit it back into my scratch file, but then if I simply save my scratch file without any further changes to the function, I get a parsing error:
.>
/home/sam/rummikub/scratch.u:5:3:
unexpected ++
expecting [, bang, binding, false, handle, if, lambda, let, namespace, quote, termLink, true, tuple, or typeLink
5 | ++ "this is the second line"
It looks like beginning the lines with the ++ operators confuses ucm, which raises the more general issue that ucm gave me back a code representation of a function that was not immediately parseable.
This may happen to many (every?) operators in long lines. I've tried this with &&:
multiLineBoolean : Boolean
multiLineBoolean =
true && true && true && true && true && true && true && true && true && true && true && true && true
and found a similar issue when editing it back out:
.> view multiLineBoolean
multiLineBoolean : Boolean
multiLineBoolean =
(((((((((((true && true) && true) && true) && true) && true) && true) && true) && true)
&&
true)
&&
true)
&&
true)
&&
true
.>
/home/sam/rummikub/scratch.u:14:3:
unexpected &&
expecting [, bang, binding, false, handle, if, lambda, let, namespace, quote, termLink, true, tuple, or typeLink
14 | &&
If I write this function:
It will parse and typecheck just fine. If I
addit to my codebase, thenviewit back out,ucmshows it to me like this:The
++operators have been moved to the beginning of the lines. I get the exact same representation if Ieditit back into my scratch file, but then if I simply save my scratch file without any further changes to the function, I get a parsing error:It looks like beginning the lines with the
++operators confusesucm, which raises the more general issue thatucmgave me back a code representation of a function that was not immediately parseable.This may happen to many (every?) operators in long lines. I've tried this with
&&:and found a similar issue when
editing it back out: