soql-parser-js
Advanced tools
Comparing version 4.1.1 to 4.2.0
# Changelog | ||
## 4.1.0 | ||
## 4.2.0 | ||
June 8, 2021 | ||
#155 - Apex bind variable support is improved to allow parsing of more complex Apex. | ||
Review test cases 112 - 117 for examples of supported apex bind variables. | ||
## 4.1.1 | ||
June 6, 2021 | ||
@@ -6,0 +14,0 @@ |
@@ -205,2 +205,3 @@ import { createToken, Lexer } from 'chevrotain'; | ||
}); | ||
export var ApexNew = createToken({ name: 'new', pattern: /new/i, longer_alt: Identifier, categories: [Keyword, Identifier] }); | ||
export var At = createToken({ name: 'AT', pattern: /AT/i, longer_alt: Identifier, categories: [Keyword, Identifier] }); | ||
@@ -667,2 +668,4 @@ export var Below = createToken({ name: 'BELOW', pattern: /BELOW/i, longer_alt: Identifier, categories: [Keyword, Identifier] }); | ||
export var RParen = createToken({ name: 'R_PAREN', pattern: ')', categories: [SymbolIdentifier] }); | ||
export var LSquareBracket = createToken({ name: 'L_SQUARE_BRACKET', pattern: '[', categories: [SymbolIdentifier] }); | ||
export var RSquareBracket = createToken({ name: 'R_SQUARE_BRACKET', pattern: ']', categories: [SymbolIdentifier] }); | ||
export var Plus = createToken({ name: 'PLUS', pattern: '+', categories: [SymbolIdentifier] }); | ||
@@ -808,2 +811,3 @@ export var Minus = createToken({ name: 'MINUS', pattern: '-', categories: [SymbolIdentifier] }); | ||
Above, | ||
ApexNew, | ||
At, | ||
@@ -926,2 +930,4 @@ Below, | ||
RParen, | ||
LSquareBracket, | ||
RSquareBracket, | ||
Plus, | ||
@@ -928,0 +934,0 @@ Minus, |
@@ -48,2 +48,3 @@ var __extends = (this && this.__extends) || (function () { | ||
_this.$_atomicExpression = undefined; | ||
_this.$_apexBindVariableExpression = undefined; | ||
_this.$_arrayExpression = undefined; | ||
@@ -481,4 +482,65 @@ _this.$_relationalOperator = undefined; | ||
_this.CONSUME(lexer.Colon); | ||
_this.OPTION(function () { | ||
_this.SUBRULE(_this.apexBindVariableNewInstantiation, { LABEL: 'apex' }); | ||
_this.OPTION1(function () { | ||
_this.CONSUME(lexer.Decimal); | ||
}); | ||
}); | ||
_this.MANY_SEP({ | ||
SEP: lexer.Decimal, | ||
DEF: function () { | ||
_this.OR(_this.$_apexBindVariableExpression || | ||
(_this.$_apexBindVariableExpression = [ | ||
{ ALT: function () { return _this.SUBRULE(_this.apexBindVariableFunctionCall, { LABEL: 'apex' }); } }, | ||
{ ALT: function () { return _this.SUBRULE(_this.apexBindVariableIdentifier, { LABEL: 'apex' }); } }, | ||
])); | ||
}, | ||
}); | ||
}); | ||
_this.apexBindVariableIdentifier = _this.RULE('apexBindVariableIdentifier', function () { | ||
_this.CONSUME(lexer.Identifier); | ||
_this.OPTION(function () { return _this.SUBRULE(_this.apexBindVariableFunctionArrayAccessor); }); | ||
}); | ||
_this.apexBindVariableNewInstantiation = _this.RULE('apexBindVariableNewInstantiation', function () { | ||
_this.CONSUME(lexer.ApexNew, { LABEL: 'new' }); | ||
_this.CONSUME(lexer.Identifier, { LABEL: 'function' }); | ||
_this.OPTION(function () { | ||
_this.SUBRULE(_this.apexBindVariableGeneric); | ||
}); | ||
_this.SUBRULE(_this.apexBindVariableFunctionParams); | ||
_this.OPTION1(function () { return _this.SUBRULE(_this.apexBindVariableFunctionArrayAccessor); }); | ||
}); | ||
_this.apexBindVariableFunctionCall = _this.RULE('apexBindVariableFunctionCall', function () { | ||
_this.CONSUME(lexer.Identifier, { LABEL: 'function' }); | ||
_this.SUBRULE(_this.apexBindVariableFunctionParams); | ||
_this.OPTION(function () { return _this.SUBRULE(_this.apexBindVariableFunctionArrayAccessor); }); | ||
}); | ||
_this.apexBindVariableGeneric = _this.RULE('apexBindVariableGeneric', function () { | ||
_this.CONSUME(lexer.LessThan); | ||
_this.AT_LEAST_ONE_SEP({ | ||
SEP: lexer.Comma, | ||
DEF: function () { | ||
_this.CONSUME(lexer.Identifier, { LABEL: 'parameter' }); | ||
}, | ||
}); | ||
_this.CONSUME(lexer.GreaterThan); | ||
}); | ||
_this.apexBindVariableFunctionParams = _this.RULE('apexBindVariableFunctionParams', function () { | ||
_this.CONSUME(lexer.LParen); | ||
_this.MANY_SEP({ | ||
SEP: lexer.Comma, | ||
DEF: function () { | ||
_this.CONSUME(lexer.Identifier, { LABEL: 'parameter' }); | ||
}, | ||
}); | ||
_this.CONSUME(lexer.RParen); | ||
}); | ||
_this.apexBindVariableFunctionArrayAccessor = _this.RULE('apexBindVariableFunctionArrayAccessor', function () { | ||
_this.CONSUME(lexer.LSquareBracket); | ||
_this.OR([ | ||
{ ALT: function () { return _this.CONSUME(lexer.UnsignedInteger, { LABEL: 'value' }); } }, | ||
{ ALT: function () { return _this.CONSUME(lexer.Identifier, { LABEL: 'value' }); } }, | ||
]); | ||
_this.CONSUME(lexer.RSquareBracket); | ||
}); | ||
_this.arrayExpression = _this.RULE('arrayExpression', function () { | ||
@@ -485,0 +547,0 @@ _this.CONSUME(lexer.LParen); |
@@ -708,4 +708,40 @@ var __extends = (this && this.__extends) || (function () { | ||
SOQLVisitor.prototype.apexBindVariableExpression = function (ctx) { | ||
return ctx.Identifier[0].image; | ||
var _this = this; | ||
return ctx.apex.map(function (item) { return _this.visit(item); }).join('.'); | ||
}; | ||
SOQLVisitor.prototype.apexBindVariableIdentifier = function (ctx) { | ||
var output = ctx.Identifier[0].image; | ||
if (ctx.apexBindVariableFunctionArrayAccessor) { | ||
output += this.visit(ctx.apexBindVariableFunctionArrayAccessor[0]); | ||
} | ||
return output; | ||
}; | ||
SOQLVisitor.prototype.apexBindVariableNewInstantiation = function (ctx) { | ||
var output = "new " + ctx.function[0].image; | ||
if (ctx.apexBindVariableGeneric) { | ||
output += this.visit(ctx.apexBindVariableGeneric[0]); | ||
} | ||
output += this.visit(ctx.apexBindVariableFunctionParams[0]); | ||
if (ctx.apexBindVariableFunctionArrayAccessor) { | ||
output += this.visit(ctx.apexBindVariableFunctionArrayAccessor[0]); | ||
} | ||
return output; | ||
}; | ||
SOQLVisitor.prototype.apexBindVariableFunctionCall = function (ctx) { | ||
var output = "" + ctx.function[0].image + this.visit(ctx.apexBindVariableFunctionParams[0]); | ||
if (ctx.apexBindVariableFunctionArrayAccessor) { | ||
output += this.visit(ctx.apexBindVariableFunctionArrayAccessor[0]); | ||
} | ||
return output; | ||
}; | ||
SOQLVisitor.prototype.apexBindVariableGeneric = function (ctx) { | ||
return "<" + ctx.parameter.map(function (item) { return item.image; }).join(', ') + ">"; | ||
}; | ||
SOQLVisitor.prototype.apexBindVariableFunctionParams = function (ctx) { | ||
var params = Array.isArray(ctx.parameter) ? ctx.parameter : []; | ||
return "(" + params.map(function (item) { return item.image; }).join(', ') + ")"; | ||
}; | ||
SOQLVisitor.prototype.apexBindVariableFunctionArrayAccessor = function (ctx) { | ||
return "[" + ctx.value[0].image + "]"; | ||
}; | ||
SOQLVisitor.prototype.arrayExpression = function (ctx) { | ||
@@ -712,0 +748,0 @@ var _this = this; |
@@ -161,4 +161,38 @@ import { CstNode, IToken } from 'chevrotain'; | ||
export interface ApexBindVariableExpressionContext { | ||
apex: CstNode[]; | ||
COLON: IToken[]; | ||
DECIMAL?: IToken[]; | ||
} | ||
export interface ApexBindVariableIdentifierContext { | ||
Identifier: IToken[]; | ||
apexBindVariableFunctionArrayAccessor?: CstNode[]; | ||
} | ||
export interface ApexBindVariableNewInstantiationContext { | ||
new: IToken[]; | ||
function: IToken[]; | ||
apexBindVariableGeneric?: CstNode[]; | ||
apexBindVariableFunctionParams: CstNode[]; | ||
apexBindVariableFunctionArrayAccessor?: CstNode[]; | ||
} | ||
export interface ApexBindVariableFunctionCallContext { | ||
function: IToken[]; | ||
apexBindVariableFunctionParams: CstNode[]; | ||
apexBindVariableFunctionArrayAccessor?: CstNode[]; | ||
} | ||
export interface ApexBindVariableGenericContext { | ||
COMMA: IToken[]; | ||
GREATER_THAN: IToken[]; | ||
LESS_THAN: IToken[]; | ||
parameter: IToken[]; | ||
} | ||
export interface ApexBindVariableFunctionParamsContext { | ||
L_PAREN: IToken[]; | ||
R_PAREN: IToken[]; | ||
parameter?: IToken[]; | ||
} | ||
export interface ApexBindVariableFunctionArrayAccessorContext { | ||
L_SQUARE_BRACKET: IToken[]; | ||
R_SQUARE_BRACKET: IToken[]; | ||
value: IToken[]; | ||
} | ||
export interface ExpressionOperatorContext { | ||
@@ -165,0 +199,0 @@ rhs: CstNode[]; |
@@ -61,2 +61,3 @@ import { TokenType } from 'chevrotain'; | ||
export declare const AboveOrBelow: TokenType; | ||
export declare const ApexNew: TokenType; | ||
export declare const At: TokenType; | ||
@@ -163,2 +164,4 @@ export declare const Below: TokenType; | ||
export declare const RParen: TokenType; | ||
export declare const LSquareBracket: TokenType; | ||
export declare const RSquareBracket: TokenType; | ||
export declare const Plus: TokenType; | ||
@@ -165,0 +168,0 @@ export declare const Minus: TokenType; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.Using = exports.True = exports.Select = exports.Rollup = exports.Or = exports.Nulls = exports.Null = exports.Not = exports.Limit = exports.Like = exports.Last = exports.Includes = exports.NotIn = exports.In = exports.Having = exports.GroupBy = exports.From = exports.First = exports.False = exports.Excludes = exports.Else = exports.Cube = exports.OrderBy = exports.Asc = exports.Desc = exports.As = exports.And = exports.WhiteSpace = exports.StringIdentifier = exports.Identifier = exports.RParenMismatch = exports.UsingScopeEnumeration = exports.IdentifierNotKeyword = exports.IntegerNumberIdentifier = exports.DecimalNumberIdentifier = exports.NumberIdentifier = exports.DateIdentifier = exports.SymbolIdentifier = exports.RelationalOperator = exports.DateNLiteral = exports.DateLiteralNotIdentifier = exports.DateLiteral = exports.OtherFunction = exports.FieldsFunctionParamIdentifier = exports.FieldsFunction = exports.LocationFunction = exports.AggregateFunction = exports.DateFunction = exports.Keyword = exports.ReservedKeyword = void 0; | ||
exports.Standard = exports.Custom = exports.All = exports.Grouping = exports.ConvertCurrency = exports.ConvertTimeZone = exports.Tolabel = exports.Format = exports.Fields = exports.Geolocation = exports.Distance = exports.Sum = exports.Max = exports.Min = exports.CountDistinct = exports.Count = exports.Avg = exports.WeekInYear = exports.WeekInMonth = exports.HourInDay = exports.FiscalYear = exports.FiscalQuarter = exports.FiscalMonth = exports.DayOnly = exports.DayInYear = exports.DayInWeek = exports.DayInMonth = exports.CalendarYear = exports.CalendarQuarter = exports.CalendarMonth = exports.SecurityEnforced = exports.When = exports.Viewstat = exports.View = exports.Typeof = exports.Then = exports.Tracking = exports.Scope = exports.Reference = exports.Offset = exports.End = exports.DataCategory = exports.Below = exports.At = exports.AboveOrBelow = exports.Above = exports.Update = exports.For = exports.With = exports.Where = void 0; | ||
exports.GreaterThanOrEqual = exports.GreaterThan = exports.LessThanOrEqual = exports.LessThan = exports.NotEqual = exports.Equal = exports.NFiscalYearsAgo = exports.LastNFiscalYears = exports.NextNFiscalYears = exports.NFiscalQuartersAgo = exports.LastNFiscalQuarters = exports.NextNFiscalQuarters = exports.NYearsAgo = exports.LastNYears = exports.NextNYears = exports.NQuartersAgo = exports.LastNQuarters = exports.NextNQuarters = exports.NMonthsAgo = exports.LastNMonths = exports.NextNMonths = exports.NWeeksAgo = exports.LastNWeeks = exports.NextNWeeks = exports.NDaysAgo = exports.LastNDays = exports.NextNDays = exports.NextFiscalYear = exports.LastFiscalYear = exports.ThisFiscalYear = exports.NextFiscalQuarter = exports.LastFiscalQuarter = exports.ThisFiscalQuarter = exports.NextYear = exports.LastYear = exports.ThisYear = exports.NextQuarter = exports.LastQuarter = exports.ThisQuarter = exports.Next90_days = exports.Last90_days = exports.NextMonth = exports.ThisMonth = exports.LastMonth = exports.NextWeek = exports.ThisWeek = exports.LastWeek = exports.Tomorrow = exports.Today = exports.Yesterday = void 0; | ||
exports.lex = exports.allTokens = exports.AllPrivate = exports.Team = exports.MyTeamTerritory = exports.MyTerritory = exports.Mine = exports.MineAndMyGroups = exports.Everything = exports.Delegated = exports.UnsignedInteger = exports.GeolocationUnit = exports.SignedInteger = exports.CurrencyPrefixedInteger = exports.UnsignedDecimal = exports.SignedDecimal = exports.CurrencyPrefixedDecimal = exports.DateToken = exports.DateTime = exports.Minus = exports.Plus = exports.RParen = exports.LParen = exports.Asterisk = exports.Comma = exports.Semicolon = exports.Colon = exports.Decimal = void 0; | ||
exports.Custom = exports.All = exports.Grouping = exports.ConvertCurrency = exports.ConvertTimeZone = exports.Tolabel = exports.Format = exports.Fields = exports.Geolocation = exports.Distance = exports.Sum = exports.Max = exports.Min = exports.CountDistinct = exports.Count = exports.Avg = exports.WeekInYear = exports.WeekInMonth = exports.HourInDay = exports.FiscalYear = exports.FiscalQuarter = exports.FiscalMonth = exports.DayOnly = exports.DayInYear = exports.DayInWeek = exports.DayInMonth = exports.CalendarYear = exports.CalendarQuarter = exports.CalendarMonth = exports.SecurityEnforced = exports.When = exports.Viewstat = exports.View = exports.Typeof = exports.Then = exports.Tracking = exports.Scope = exports.Reference = exports.Offset = exports.End = exports.DataCategory = exports.Below = exports.At = exports.ApexNew = exports.AboveOrBelow = exports.Above = exports.Update = exports.For = exports.With = exports.Where = void 0; | ||
exports.GreaterThan = exports.LessThanOrEqual = exports.LessThan = exports.NotEqual = exports.Equal = exports.NFiscalYearsAgo = exports.LastNFiscalYears = exports.NextNFiscalYears = exports.NFiscalQuartersAgo = exports.LastNFiscalQuarters = exports.NextNFiscalQuarters = exports.NYearsAgo = exports.LastNYears = exports.NextNYears = exports.NQuartersAgo = exports.LastNQuarters = exports.NextNQuarters = exports.NMonthsAgo = exports.LastNMonths = exports.NextNMonths = exports.NWeeksAgo = exports.LastNWeeks = exports.NextNWeeks = exports.NDaysAgo = exports.LastNDays = exports.NextNDays = exports.NextFiscalYear = exports.LastFiscalYear = exports.ThisFiscalYear = exports.NextFiscalQuarter = exports.LastFiscalQuarter = exports.ThisFiscalQuarter = exports.NextYear = exports.LastYear = exports.ThisYear = exports.NextQuarter = exports.LastQuarter = exports.ThisQuarter = exports.Next90_days = exports.Last90_days = exports.NextMonth = exports.ThisMonth = exports.LastMonth = exports.NextWeek = exports.ThisWeek = exports.LastWeek = exports.Tomorrow = exports.Today = exports.Yesterday = exports.Standard = void 0; | ||
exports.lex = exports.allTokens = exports.AllPrivate = exports.Team = exports.MyTeamTerritory = exports.MyTerritory = exports.Mine = exports.MineAndMyGroups = exports.Everything = exports.Delegated = exports.UnsignedInteger = exports.GeolocationUnit = exports.SignedInteger = exports.CurrencyPrefixedInteger = exports.UnsignedDecimal = exports.SignedDecimal = exports.CurrencyPrefixedDecimal = exports.DateToken = exports.DateTime = exports.Minus = exports.Plus = exports.RSquareBracket = exports.LSquareBracket = exports.RParen = exports.LParen = exports.Asterisk = exports.Comma = exports.Semicolon = exports.Colon = exports.Decimal = exports.GreaterThanOrEqual = void 0; | ||
var chevrotain_1 = require("chevrotain"); | ||
@@ -211,2 +211,3 @@ exports.ReservedKeyword = chevrotain_1.createToken({ | ||
}); | ||
exports.ApexNew = chevrotain_1.createToken({ name: 'new', pattern: /new/i, longer_alt: exports.Identifier, categories: [exports.Keyword, exports.Identifier] }); | ||
exports.At = chevrotain_1.createToken({ name: 'AT', pattern: /AT/i, longer_alt: exports.Identifier, categories: [exports.Keyword, exports.Identifier] }); | ||
@@ -673,2 +674,4 @@ exports.Below = chevrotain_1.createToken({ name: 'BELOW', pattern: /BELOW/i, longer_alt: exports.Identifier, categories: [exports.Keyword, exports.Identifier] }); | ||
exports.RParen = chevrotain_1.createToken({ name: 'R_PAREN', pattern: ')', categories: [exports.SymbolIdentifier] }); | ||
exports.LSquareBracket = chevrotain_1.createToken({ name: 'L_SQUARE_BRACKET', pattern: '[', categories: [exports.SymbolIdentifier] }); | ||
exports.RSquareBracket = chevrotain_1.createToken({ name: 'R_SQUARE_BRACKET', pattern: ']', categories: [exports.SymbolIdentifier] }); | ||
exports.Plus = chevrotain_1.createToken({ name: 'PLUS', pattern: '+', categories: [exports.SymbolIdentifier] }); | ||
@@ -814,2 +817,3 @@ exports.Minus = chevrotain_1.createToken({ name: 'MINUS', pattern: '-', categories: [exports.SymbolIdentifier] }); | ||
exports.Above, | ||
exports.ApexNew, | ||
exports.At, | ||
@@ -932,2 +936,4 @@ exports.Below, | ||
exports.RParen, | ||
exports.LSquareBracket, | ||
exports.RSquareBracket, | ||
exports.Plus, | ||
@@ -934,0 +940,0 @@ exports.Minus, |
@@ -15,2 +15,3 @@ import { CstParser, IRecognitionException } from 'chevrotain'; | ||
private $_atomicExpression; | ||
private $_apexBindVariableExpression; | ||
private $_arrayExpression; | ||
@@ -66,2 +67,8 @@ private $_relationalOperator; | ||
private apexBindVariableExpression; | ||
private apexBindVariableIdentifier; | ||
private apexBindVariableNewInstantiation; | ||
private apexBindVariableFunctionCall; | ||
private apexBindVariableGeneric; | ||
private apexBindVariableFunctionParams; | ||
private apexBindVariableFunctionArrayAccessor; | ||
private arrayExpression; | ||
@@ -68,0 +75,0 @@ private relationalOperator; |
@@ -51,2 +51,3 @@ "use strict"; | ||
_this.$_atomicExpression = undefined; | ||
_this.$_apexBindVariableExpression = undefined; | ||
_this.$_arrayExpression = undefined; | ||
@@ -484,4 +485,65 @@ _this.$_relationalOperator = undefined; | ||
_this.CONSUME(lexer.Colon); | ||
_this.OPTION(function () { | ||
_this.SUBRULE(_this.apexBindVariableNewInstantiation, { LABEL: 'apex' }); | ||
_this.OPTION1(function () { | ||
_this.CONSUME(lexer.Decimal); | ||
}); | ||
}); | ||
_this.MANY_SEP({ | ||
SEP: lexer.Decimal, | ||
DEF: function () { | ||
_this.OR(_this.$_apexBindVariableExpression || | ||
(_this.$_apexBindVariableExpression = [ | ||
{ ALT: function () { return _this.SUBRULE(_this.apexBindVariableFunctionCall, { LABEL: 'apex' }); } }, | ||
{ ALT: function () { return _this.SUBRULE(_this.apexBindVariableIdentifier, { LABEL: 'apex' }); } }, | ||
])); | ||
}, | ||
}); | ||
}); | ||
_this.apexBindVariableIdentifier = _this.RULE('apexBindVariableIdentifier', function () { | ||
_this.CONSUME(lexer.Identifier); | ||
_this.OPTION(function () { return _this.SUBRULE(_this.apexBindVariableFunctionArrayAccessor); }); | ||
}); | ||
_this.apexBindVariableNewInstantiation = _this.RULE('apexBindVariableNewInstantiation', function () { | ||
_this.CONSUME(lexer.ApexNew, { LABEL: 'new' }); | ||
_this.CONSUME(lexer.Identifier, { LABEL: 'function' }); | ||
_this.OPTION(function () { | ||
_this.SUBRULE(_this.apexBindVariableGeneric); | ||
}); | ||
_this.SUBRULE(_this.apexBindVariableFunctionParams); | ||
_this.OPTION1(function () { return _this.SUBRULE(_this.apexBindVariableFunctionArrayAccessor); }); | ||
}); | ||
_this.apexBindVariableFunctionCall = _this.RULE('apexBindVariableFunctionCall', function () { | ||
_this.CONSUME(lexer.Identifier, { LABEL: 'function' }); | ||
_this.SUBRULE(_this.apexBindVariableFunctionParams); | ||
_this.OPTION(function () { return _this.SUBRULE(_this.apexBindVariableFunctionArrayAccessor); }); | ||
}); | ||
_this.apexBindVariableGeneric = _this.RULE('apexBindVariableGeneric', function () { | ||
_this.CONSUME(lexer.LessThan); | ||
_this.AT_LEAST_ONE_SEP({ | ||
SEP: lexer.Comma, | ||
DEF: function () { | ||
_this.CONSUME(lexer.Identifier, { LABEL: 'parameter' }); | ||
}, | ||
}); | ||
_this.CONSUME(lexer.GreaterThan); | ||
}); | ||
_this.apexBindVariableFunctionParams = _this.RULE('apexBindVariableFunctionParams', function () { | ||
_this.CONSUME(lexer.LParen); | ||
_this.MANY_SEP({ | ||
SEP: lexer.Comma, | ||
DEF: function () { | ||
_this.CONSUME(lexer.Identifier, { LABEL: 'parameter' }); | ||
}, | ||
}); | ||
_this.CONSUME(lexer.RParen); | ||
}); | ||
_this.apexBindVariableFunctionArrayAccessor = _this.RULE('apexBindVariableFunctionArrayAccessor', function () { | ||
_this.CONSUME(lexer.LSquareBracket); | ||
_this.OR([ | ||
{ ALT: function () { return _this.CONSUME(lexer.UnsignedInteger, { LABEL: 'value' }); } }, | ||
{ ALT: function () { return _this.CONSUME(lexer.Identifier, { LABEL: 'value' }); } }, | ||
]); | ||
_this.CONSUME(lexer.RSquareBracket); | ||
}); | ||
_this.arrayExpression = _this.RULE('arrayExpression', function () { | ||
@@ -488,0 +550,0 @@ _this.CONSUME(lexer.LParen); |
@@ -711,4 +711,40 @@ "use strict"; | ||
SOQLVisitor.prototype.apexBindVariableExpression = function (ctx) { | ||
return ctx.Identifier[0].image; | ||
var _this = this; | ||
return ctx.apex.map(function (item) { return _this.visit(item); }).join('.'); | ||
}; | ||
SOQLVisitor.prototype.apexBindVariableIdentifier = function (ctx) { | ||
var output = ctx.Identifier[0].image; | ||
if (ctx.apexBindVariableFunctionArrayAccessor) { | ||
output += this.visit(ctx.apexBindVariableFunctionArrayAccessor[0]); | ||
} | ||
return output; | ||
}; | ||
SOQLVisitor.prototype.apexBindVariableNewInstantiation = function (ctx) { | ||
var output = "new " + ctx.function[0].image; | ||
if (ctx.apexBindVariableGeneric) { | ||
output += this.visit(ctx.apexBindVariableGeneric[0]); | ||
} | ||
output += this.visit(ctx.apexBindVariableFunctionParams[0]); | ||
if (ctx.apexBindVariableFunctionArrayAccessor) { | ||
output += this.visit(ctx.apexBindVariableFunctionArrayAccessor[0]); | ||
} | ||
return output; | ||
}; | ||
SOQLVisitor.prototype.apexBindVariableFunctionCall = function (ctx) { | ||
var output = "" + ctx.function[0].image + this.visit(ctx.apexBindVariableFunctionParams[0]); | ||
if (ctx.apexBindVariableFunctionArrayAccessor) { | ||
output += this.visit(ctx.apexBindVariableFunctionArrayAccessor[0]); | ||
} | ||
return output; | ||
}; | ||
SOQLVisitor.prototype.apexBindVariableGeneric = function (ctx) { | ||
return "<" + ctx.parameter.map(function (item) { return item.image; }).join(', ') + ">"; | ||
}; | ||
SOQLVisitor.prototype.apexBindVariableFunctionParams = function (ctx) { | ||
var params = Array.isArray(ctx.parameter) ? ctx.parameter : []; | ||
return "(" + params.map(function (item) { return item.image; }).join(', ') + ")"; | ||
}; | ||
SOQLVisitor.prototype.apexBindVariableFunctionArrayAccessor = function (ctx) { | ||
return "[" + ctx.value[0].image + "]"; | ||
}; | ||
SOQLVisitor.prototype.arrayExpression = function (ctx) { | ||
@@ -715,0 +751,0 @@ var _this = this; |
{ | ||
"name": "soql-parser-js", | ||
"version": "4.1.1", | ||
"version": "4.2.0", | ||
"description": "Salesforce.com SOQL parser and composer", | ||
@@ -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 not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1319607
19904