Fix LSP crash and tokenizer issue
This commit is contained in:
@@ -165,7 +165,8 @@ rawTokenise ts@(TS sl sc toks chars) = case chars of
|
||||
doChar : Char -> List Char -> Either Error TState
|
||||
doChar c cs = if elem c standalone
|
||||
then rawTokenise (TS sl (sc + 1) (toks :< mktok True sl (sc + 1) Symbol (pack $ c :: Nil)) cs)
|
||||
else let kind = if isDigit c then Number else if isUpper c then UIdent else Ident in
|
||||
else if isDigit c then doRest (TS sl sc toks (c :: cs)) Number isDigit Lin
|
||||
else let kind = if isUpper c then UIdent else Ident in
|
||||
doRest (TS sl sc toks (c :: cs)) kind isIdent Lin
|
||||
|
||||
|
||||
|
||||
@@ -456,8 +456,7 @@ debugLog a = putStrLn (debugStr a)
|
||||
|
||||
pfunc stringToInt : String → Int := `(s) => {
|
||||
let rval = Number(s)
|
||||
if (isNaN(rval)) throw new Error(s + " is NaN")
|
||||
return rval
|
||||
return isNaN(rval) ? 0 : rval
|
||||
}`
|
||||
|
||||
class Foldable (m : U → U) where
|
||||
|
||||
Reference in New Issue
Block a user