@malloydata/malloy
Advanced tools
Comparing version 0.0.15-dev221207234955 to 0.0.15-dev221208001612
import { ParseTreeVisitor } from "antlr4ts/tree/ParseTreeVisitor"; | ||
import { ExprPartialCompareContext } from "./MalloyParser"; | ||
import { ExprNotPartialContext } from "./MalloyParser"; | ||
import { NameMemberContext } from "./MalloyParser"; | ||
@@ -184,16 +182,2 @@ import { WildMemberContext } from "./MalloyParser"; | ||
/** | ||
* Visit a parse tree produced by the `exprPartialCompare` | ||
* labeled alternative in `MalloyParser.partialAllowedFieldExpr`. | ||
* @param ctx the parse tree | ||
* @return the visitor result | ||
*/ | ||
visitExprPartialCompare?: (ctx: ExprPartialCompareContext) => Result; | ||
/** | ||
* Visit a parse tree produced by the `exprNotPartial` | ||
* labeled alternative in `MalloyParser.partialAllowedFieldExpr`. | ||
* @param ctx the parse tree | ||
* @return the visitor result | ||
*/ | ||
visitExprNotPartial?: (ctx: ExprNotPartialContext) => Result; | ||
/** | ||
* Visit a parse tree produced by the `nameMember` | ||
@@ -200,0 +184,0 @@ * labeled alternative in `MalloyParser.collectionMember`. |
@@ -117,4 +117,3 @@ import { ParserRuleContext } from "antlr4ts"; | ||
visitExprLogicalTree(pcx: parse.ExprLogicalTreeContext): ast.ExprAlternationTree; | ||
visitExprNotPartial(pcx: parse.ExprNotPartialContext): ast.ExpressionDef; | ||
visitExprPartialCompare(pcx: parse.ExprPartialCompareContext): ast.MalloyElement; | ||
visitPartialAllowedFieldExpr(pcx: parse.PartialAllowedFieldExprContext): ast.ExpressionDef; | ||
visitExprString(pcx: parse.ExprStringContext): ast.ExprString; | ||
@@ -121,0 +120,0 @@ visitExprRegex(pcx: parse.ExprRegexContext): ast.ExprRegEx; |
@@ -689,11 +689,13 @@ "use strict"; | ||
} | ||
visitExprNotPartial(pcx) { | ||
return this.getFieldExpr(pcx.fieldExpr()); | ||
} | ||
visitExprPartialCompare(pcx) { | ||
const op = pcx.compareOp().text; | ||
if (ast.isComparison(op)) { | ||
return new ast.PartialCompare(op, this.getFieldExpr(pcx.fieldExpr())); | ||
visitPartialAllowedFieldExpr(pcx) { | ||
var _a; | ||
const fieldExpr = this.getFieldExpr(pcx.fieldExpr()); | ||
const partialOp = (_a = pcx.compareOp()) === null || _a === void 0 ? void 0 : _a.text; | ||
if (partialOp) { | ||
if (ast.isComparison(partialOp)) { | ||
return this.astAt(new ast.PartialCompare(partialOp, fieldExpr), pcx); | ||
} | ||
throw this.internalError(pcx, `partial comparison '${partialOp}' not recognized`); | ||
} | ||
throw this.internalError(pcx, `partial comparison '${op}' not recognized`); | ||
return fieldExpr; | ||
} | ||
@@ -700,0 +702,0 @@ visitExprString(pcx) { |
{ | ||
"name": "@malloydata/malloy", | ||
"version": "0.0.15-dev221207234955", | ||
"version": "0.0.15-dev221208001612", | ||
"license": "GPL-2.0", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
33
16
1578233
3735
41066