@iebh/polyglot 4.7.9 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/modules/parse.js +3 -10
- package/package.json +1 -1
package/lib/modules/parse.js
CHANGED
|
@@ -503,7 +503,7 @@ var parse = function parse(query, options) {
|
|
|
503
503
|
afterWhitespace = true;
|
|
504
504
|
}
|
|
505
505
|
// Match field codes {{{
|
|
506
|
-
else if (
|
|
506
|
+
else if (match = new RegExp("^(".concat(fieldCodes, ") *(\\[mp=[^\\]\\n]*\\])?"), "i").exec(q)) {
|
|
507
507
|
// Field specifier - PubMed syntax
|
|
508
508
|
// Figure out the leaf to use (usually the last one) or the previously used group
|
|
509
509
|
var useLeaf;
|
|
@@ -511,6 +511,8 @@ var parse = function parse(query, options) {
|
|
|
511
511
|
useLeaf = leaf;
|
|
512
512
|
} else if (_lodash["default"].isArray(leaf) && lastGroup) {
|
|
513
513
|
useLeaf = lastGroup;
|
|
514
|
+
} else if (_lodash["default"].isObject(leaf) && leaf.type == 'mesh') {
|
|
515
|
+
useLeaf = leaf;
|
|
514
516
|
}
|
|
515
517
|
useLeaf.field = _fieldCodesParse["default"][match[1].toLowerCase()];
|
|
516
518
|
if (match[2]) {
|
|
@@ -521,15 +523,6 @@ var parse = function parse(query, options) {
|
|
|
521
523
|
q = q.substr(match[1].length);
|
|
522
524
|
}
|
|
523
525
|
cropString = false;
|
|
524
|
-
} else if (_lodash["default"].isObject(leaf) && leaf.type == 'mesh' && (match = new RegExp("^(".concat(fieldCodes, ") *(\\[mp=[^\\]\\n]*\\])?"), "i").exec(q))) {
|
|
525
|
-
// Field specifier - PubMed syntax
|
|
526
|
-
// Figure out the leaf to use (usually the last one) or the previously used group
|
|
527
|
-
var useLeaf = leaf;
|
|
528
|
-
useLeaf.field = _fieldCodesParse["default"][match[1].toLowerCase()];
|
|
529
|
-
leaf = undefined;
|
|
530
|
-
offset += match[0].length;
|
|
531
|
-
q = q.substr(match[0].length);
|
|
532
|
-
cropString = false;
|
|
533
526
|
}
|
|
534
527
|
// }}}
|
|
535
528
|
/// Comment {{{
|