forked from GitHub/gf-rgl
the Error type; better lexer error reporting
This commit is contained in:
@@ -11,9 +11,11 @@ resource Predef = {
|
|||||||
|
|
||||||
param PBool = PTrue | PFalse ;
|
param PBool = PTrue | PFalse ;
|
||||||
|
|
||||||
oper Int : Type = variants {} ; -- the type of integers
|
oper Error : Type = variants {} ; -- the empty type
|
||||||
oper Ints : Int -> Type = variants {} ; -- the type of integers from 0 to n
|
oper Int : Type = variants {} ; -- the type of integers
|
||||||
|
oper Ints : Int -> Type = variants {} ; -- the type of integers from 0 to n
|
||||||
|
|
||||||
|
oper error : Str -> Error = variants {} ; -- forms error message
|
||||||
oper length : Tok -> Int = variants {} ; -- length of string
|
oper length : Tok -> Int = variants {} ; -- length of string
|
||||||
oper drop : Int -> Tok -> Tok = variants {} ; -- drop prefix of length
|
oper drop : Int -> Tok -> Tok = variants {} ; -- drop prefix of length
|
||||||
oper take : Int -> Tok -> Tok = variants {} ; -- take prefix of length
|
oper take : Int -> Tok -> Tok = variants {} ; -- take prefix of length
|
||||||
|
|||||||
@@ -418,8 +418,13 @@ oper
|
|||||||
in mkV cry cries cried cried crying ;
|
in mkV cry cries cried cried crying ;
|
||||||
|
|
||||||
regDuplV fit =
|
regDuplV fit =
|
||||||
let fitt = fit + last fit in
|
case last fit of {
|
||||||
mkV fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing") ;
|
("a" | "e" | "i" | "o" | "u" | "y") =>
|
||||||
|
Predef.error (["final duplication makes no sense for"] ++ fit) ;
|
||||||
|
t =>
|
||||||
|
let fitt = fit + t in
|
||||||
|
mkV fit (fit + "s") (fitt + "ed") (fitt + "ed") (fitt + "ing")
|
||||||
|
} ;
|
||||||
|
|
||||||
irregV x y z = let reg = (regV x).s in
|
irregV x y z = let reg = (regV x).s in
|
||||||
mkV x (reg ! VPres) y z (reg ! VPresPart) ** {s1 = [] ; lock_V = <>} ;
|
mkV x (reg ! VPres) y z (reg ! VPresPart) ** {s1 = [] ; lock_V = <>} ;
|
||||||
|
|||||||
Reference in New Issue
Block a user