Skip to content

Commit

Permalink
reorder a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
yinwang0 committed Feb 3, 2014
1 parent dfe2cf9 commit 819b8a8
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/main/java/org/yinwang/yin/parser/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ public static Node parseNode(Node prenode) {
}
}

// -------------------- declare --------------------
if (keyword.equals(Constants.DECLARE_KEYWORD)) {
if (elements.size() < 2) {
_.abort(tuple, "syntax error in record type definition");
}
Scope properties = parseProperties(elements.subList(1, elements.size()));
return new Declare(properties, prenode.file,
prenode.start, prenode.end, prenode.line, prenode.col);
}

// -------------------- anonymous function --------------------
if (keyword.equals(Constants.FUN_KEYWORD)) {
if (elements.size() < 3) {
Expand Down Expand Up @@ -199,15 +209,6 @@ public static Node parseNode(Node prenode) {
return new RecordDef((Name) name, parents, properties, prenode.file,
prenode.start, prenode.end, prenode.line, prenode.col);
}

if (keyword.equals(Constants.DECLARE_KEYWORD)) {
if (elements.size() < 2) {
_.abort(tuple, "syntax error in record type definition");
}
Scope properties = parseProperties(elements.subList(1, elements.size()));
return new Declare(properties, prenode.file,
prenode.start, prenode.end, prenode.line, prenode.col);
}
}

// -------------------- application --------------------
Expand Down

0 comments on commit 819b8a8

Please sign in to comment.