|
@ -374,7 +374,7 @@ function parseDefType(tokens, linenum, charnum) { |
|
|
return parseDataType(tokens, linenum, charnum); |
|
|
return parseDataType(tokens, linenum, charnum); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (notFollowedBy(tokens, ["constructor"]. linenum, charnum)) { |
|
|
if (notFollowedBy(tokens, ["constructor"], linenum, charnum)) { |
|
|
throw error.JSyntaxError(linenum, |
|
|
throw error.JSyntaxError(linenum, |
|
|
charnum, |
|
|
charnum, |
|
|
"deftype must be followed by a single constructor" + |
|
|
"deftype must be followed by a single constructor" + |
|
@ -400,6 +400,8 @@ function parseDefType(tokens, linenum, charnum) { |
|
|
rhs.charnum, |
|
|
rhs.charnum, |
|
|
"was expecting an application or type operator on the right-hand side of a type definition"); |
|
|
"was expecting an application or type operator on the right-hand side of a type definition"); |
|
|
} |
|
|
} |
|
|
|
|
|
result = new typ.DefType(lhs, rhs); |
|
|
|
|
|
return result; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -737,6 +739,9 @@ function parse(tokens) { |
|
|
toktype === "let") { |
|
|
toktype === "let") { |
|
|
return parseDef(tokens, linenum, charnum); |
|
|
return parseDef(tokens, linenum, charnum); |
|
|
} |
|
|
} |
|
|
|
|
|
else if (toktype === "deftype") { |
|
|
|
|
|
return parseDefType(tokens, linenum, charnum); |
|
|
|
|
|
} |
|
|
else if (toktype === "defop") { |
|
|
else if (toktype === "defop") { |
|
|
return parseDefOp(tokens, linenum, charnum); |
|
|
return parseDefOp(tokens, linenum, charnum); |
|
|
} |
|
|
} |
|
|