Skip to content

Commit

Permalink
Update constant op declaration parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
will62794 committed Jan 21, 2025
1 parent 6cb3d9c commit 1d24f09
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions js/eval.js
Original file line number Diff line number Diff line change
Expand Up @@ -1853,14 +1853,16 @@ class TLASpec {
if (node.type === "constant_declaration") {
let constDecls = cursor.currentNode().namedChildren.filter(c => c.type !== "comment");
for (const declNode of constDecls) {
let constDeclName = null;
if (declNode.type === "operator_declaration") {
// e.g. CONSTANT Op(_,_)
// Just save the operator name directly.
let opName = node.childForFieldName("quantifier");
const_decls[opName] = { "id": declNode.id };
constDeclName = declNode.childForFieldName("name").text;
} else {
const_decls[declNode.text] = { "id": declNode.id };
constDeclName = declNode.text
}
const_decls[constDeclName] = { "id": declNode.id };
evalLog("Added CONSTANT decl:", constDeclName, node.namedChildren);
}
}

Expand Down

0 comments on commit 1d24f09

Please sign in to comment.