Fixing constraint bug, pretty printing constraints
This commit is contained in:
parent
784e095345
commit
479abf7996
2 changed files with 6 additions and 4 deletions
|
|
@ -185,7 +185,9 @@ export class Parser {
|
|||
let annotation: Annotation | undefined;
|
||||
if (this.current().kind === 'colon') {
|
||||
this.advance();
|
||||
annotation = { constraints: this.parsedConstraints, type: this.parseType() };
|
||||
const constraints = this.tryParseConstraints();
|
||||
const type = this.parseType();
|
||||
annotation = { constraints, type };
|
||||
|
||||
// Declaration only
|
||||
if (this.current().kind === 'semicolon') {
|
||||
|
|
@ -633,8 +635,6 @@ export class Parser {
|
|||
|
||||
private parseType(): TypeAST {
|
||||
// Check for constraints: Num a, Eq b :: <type>
|
||||
this.parsedConstraints = this.tryParseConstraints();
|
||||
|
||||
const left = this.parseTypeApply();
|
||||
|
||||
if (this.current().kind === 'backslash') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue