Adv item search: don't use identifiers with '+' so tokenization of addition operator works properly

This commit is contained in:
phantamanta44 2021-01-30 17:59:53 -06:00
parent e33d3735b5
commit 19534cdea0
2 changed files with 5 additions and 5 deletions

View file

@ -98,7 +98,7 @@ Left of colon is what you type into the search bar (sometimes multiple things ca
['spelldmg', 'spelldam', 'spelldmg%', 'spelldam%', 'sdpct']: Spell Damage (%)
['spellrawdmg', 'spellrawdam', 'spellneutraldmg', 'spellneutraldam', 'sdraw']: Spell Damage (Raw)
['attackspeed', 'atkspd']: Item Attack Speed
['bonusattackspeed', 'bonusatkspd', 'attackspeedid', 'atkspdid', 'attackspeed+', 'atkspd+', 'atktier']: Attack Speed Bonus
['bonusattackspeed', 'bonusatkspd', 'attackspeedid', 'atkspdid', 'atktier']: Attack Speed Bonus
['sumattackspeed', 'totalattackspeed', 'sumatkspd', 'totalatkspd', 'sumatktier', 'totalatktier']: Total Attack Speed (Base speed + bonus)
['earthdef', 'edef']: Earth Defense Raw
@ -116,7 +116,7 @@ Left of colon is what you type into the search bar (sometimes multiple things ca
['sumdef%', 'totaldef%', 'sumdefpct', 'totaldefpct']: Total Defense %
['health', 'hp']: Health
['bonushealth', 'healthid', 'bonushp', 'hpid', 'health+', 'hp+', 'hpbonus']: Health bonus
['bonushealth', 'healthid', 'bonushp', 'hpid', 'hpbonus']: Health bonus
['sumhealth', 'sumhp', 'totalhealth', 'totalhp']: Total Health (health + health bonus)
['hpregen', 'hpr', 'hr', 'hprraw']: Raw Health Regen

View file

@ -156,7 +156,7 @@ const itemQueryProps = (function() {
const atkSpdIndices = { SUPER_SLOW: -3, VERY_SLOW: -2, SLOW: -1, NORMAL: 0, FAST: 1, VERY_FAST: 2, SUPER_FAST: 3 };
prop(['attackspeed', 'atkspd'], (i, ie) => i.atkSpd ? atkSpdIndices[i.atkSpd] : 0);
maxId(['bonusattackspeed', 'bonusatkspd', 'attackspeedid', 'atkspdid', 'attackspeed+', 'atkspd+', 'atktier'], 'atkTier');
maxId(['bonusattackspeed', 'bonusatkspd', 'attackspeedid', 'atkspdid', 'atktier'], 'atkTier');
sum(['sumattackspeed', 'totalattackspeed', 'sumatkspd', 'totalatkspd', 'sumatktier', 'totalatktier'], props.atkspd, props.atktier);
prop(['earthdef', 'edef'], (i, ie) => i.eDef || 0);
@ -174,7 +174,7 @@ const itemQueryProps = (function() {
sum(['sumdef%', 'totaldef%', 'sumdefpct', 'totaldefpct'], props.edefpct, props.tdefpct, props.wdefpct, props.fdefpct, props.adefpct);
prop(['health', 'hp'], (i, ie) => i.hp || 0);
maxId(['bonushealth', 'healthid', 'bonushp', 'hpid', 'health+', 'hp+', 'hpbonus'], 'hpBonus');
maxId(['bonushealth', 'healthid', 'bonushp', 'hpid', 'hpbonus'], 'hpBonus');
sum(['sumhealth', 'sumhp', 'totalhealth', 'totalhp'], props.hp, props.hpid);
maxId(['hpregen', 'hpr', 'hr', 'hprraw'], 'hprRaw');
@ -332,7 +332,7 @@ const compileQueryExpr = (function() {
continue;
}
// parse an identifier or boolean literal
if ((m = /^\w[\w\d+%]*/.exec(exprStr.substring(col))) !== null) {
if ((m = /^\w[\w\d%]*/.exec(exprStr.substring(col))) !== null) {
switch (m[0]) {
case 'true':
tokens.push({ type: 'bool', value: true });