@@ -385,6 +385,7 @@ infixOp =
385385 Parser $ \(State array offset length indent row col) cok cerr _ eerr ->
386386 if length == 0 then
387387 eerr (Error row col)
388+
388389 else
389390 case infixOpHelp array offset length row col of
390391 Left err ->
@@ -392,21 +393,25 @@ infixOp =
392393
393394 Right ( newOffset, newLength, newCol ) ->
394395 let
395− !newSize =
396+ !size =
396397 newOffset - offset
397398
398399 makeArray =
399− do mutableArray <- Text.new newSize
400− Text.copyI mutableArray 0 array offset newSize
400+ do mutableArray <- Text.new size
401+ Text.copyI mutableArray 0 array offset size
401402 return mutableArray
402403 in
403− case Text.Text (Text.run makeArray) 0 newSize of
404− "=" -> cerr (Error row col) -- "The = operator is reserved for defining variables. Maybe you want == instead? Or maybe you are defining a variable, but there is whitespace before it?"
405− "->" -> cerr (Error row col) -- "Arrows are reserved for cases and anonymous functions. Maybe you want > or >= instead?"
406− "|" -> cerr (Error row col) -- "Vertical bars are reserved for use in union type declarations. Maybe you want || instead?"
407− ":" -> cerr (Error row col) -- "A single colon is for type annotations. Maybe you want :: instead? Or maybe you are defining a type annotation, but there is whitespace before it?"
408− "." -> cerr (Error row col) -- "Dots are for record access. They cannot float around on their own!"
409− op -> cok op (State array newOffset newLength indent row newCol)
404+ if size == 0 then
405+ eerr (Error row col)
406+
407+ else
408+ case Text.Text (Text.run makeArray) 0 size of
409+ "=" -> cerr (Error row col) -- "The = operator is reserved for defining variables. Maybe you want == instead? Or maybe you are defining a variable, but there is whitespace before it?"
410+ "->" -> cerr (Error row col) -- "Arrows are reserved for cases and anonymous functions. Maybe you want > or >= instead?"
411+ "|" -> cerr (Error row col) -- "Vertical bars are reserved for use in union type declarations. Maybe you want || instead?"
412+ ":" -> cerr (Error row col) -- "A single colon is for type annotations. Maybe you want :: instead? Or maybe you are defining a type annotation, but there is whitespace before it?"
413+ "." -> cerr (Error row col) -- "Dots are for record access. They cannot float around on their own!"
414+ op -> cok op (State array newOffset newLength indent row newCol)
410415
411416
412417infixOpHelp :: Text.Array -> Int -> Int -> Int -> Int -> Either Error (Int, Int, Int)