@xuda.io/runtime-bundle 1.0.481 → 1.0.483

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.
@@ -5099,6 +5099,15 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5099
5099
  }
5100
5100
  };
5101
5101
 
5102
+ const update_xu_ref = async function () {
5103
+ let _ds_0 = _session.DS_GLB[0];
5104
+ for ([ref_name, val] of Object.entries(_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'])) {
5105
+ if (val.ds.dsSession == dataSource) {
5106
+ func.UI.update_xu_ref(SESSION_ID, dataSource, ref_name);
5107
+ }
5108
+ }
5109
+ };
5110
+
5102
5111
  var fields_changed = [];
5103
5112
  var datasource_changed = [];
5104
5113
  let client_datasource_changes = {};
@@ -5116,6 +5125,7 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5116
5125
  // mechanism to make update directly on the datasource object
5117
5126
  if (record_id === 'datasource_main') {
5118
5127
  _.set(_ds, field_id, value);
5128
+ update_xu_ref();
5119
5129
  continue;
5120
5130
  }
5121
5131
 
@@ -5133,15 +5143,16 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5133
5143
  await set_fieldComputed_dependencies(dataSource, field_id, null);
5134
5144
 
5135
5145
  // search the field in refs
5136
- let _ds_0 = _session.DS_GLB[0];
5137
- for ([ref_name, val] of Object.entries(_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'])) {
5138
- if (val.ds.dsSession == dataSource) {
5139
- func.UI.update_xu_ref(SESSION_ID, dataSource, ref_name);
5140
- // if (!fields_changed.includes(ref_name)) {
5141
- // fields_changed.push(ref_name);
5142
- // }
5143
- }
5144
- }
5146
+ update_xu_ref();
5147
+ // let _ds_0 = _session.DS_GLB[0];
5148
+ // for ([ref_name, val] of Object.entries(_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'])) {
5149
+ // if (val.ds.dsSession == dataSource) {
5150
+ // func.UI.update_xu_ref(SESSION_ID, dataSource, ref_name);
5151
+ // // if (!fields_changed.includes(ref_name)) {
5152
+ // // fields_changed.push(ref_name);
5153
+ // // }
5154
+ // }
5155
+ // }
5145
5156
 
5146
5157
  if (!update_local_scope_only) {
5147
5158
  let tree_ret = await func.utils.TREE_OBJ.get(SESSION_ID, _ds.prog_id);
@@ -10816,102 +10827,102 @@ func.expression.get = async function (SESSION_ID, valP, dsSessionP, sourceP, row
10816
10827
  return new_class.get();
10817
10828
  };
10818
10829
 
10819
- // func.expression.parse = function (strP) {
10820
- // var extract_str = function (strP, posP) {
10821
- // if (!posP) posP = 0;
10822
- // var clean_split_str = function (arrP) {
10823
- // var arr = [];
10824
- // if (arrP && arrP.length > 1 && arrP[0] === '' && arrP[1].indexOf('@') > -1) {
10825
- // for (var i = 1; i <= arrP.length; i++) {
10826
- // arr.push(arrP[i]);
10827
- // }
10828
- // return arr;
10829
- // } else return arrP;
10830
- // };
10831
- // var nonLettersPatt = /\W/; // non letters
10832
- // var validSymbolsNoArray = /[^.@\[]/; //valid symbols no array /[^.@\[\]\]]/
10833
- // var validSymbolsWithArray = /[^.@"'\[\]]/; //valid symbols with array
10834
- // var validSymbols = validSymbolsNoArray;
10835
- // var splitTmp = strP.replace(/@/g, '^^@').split('^^');
10836
- // var split = clean_split_str(splitTmp);
10837
- // var obj = [];
10838
- // if (split) {
10839
- // for (let val of split) {
10840
- // // run on @ segments
10841
- // if (val) {
10842
- // var pos = strP.indexOf(val);
10843
- // if (val && val.substr(0, 1) === '@') {
10844
- // var tmpStr = '';
10845
- // var word_start_pos = undefined;
10846
- // var word_end_pos = undefined;
10847
- // // run on @ segment string
10848
- // for (var i = 0; i <= val.length; i++) {
10849
- // var key1 = i;
10850
- // var val1 = val.substr(i, 1);
10851
- // if (
10852
- // val1 === '.' &&
10853
- // !word_start_pos // find first dot
10854
- // )
10855
- // word_start_pos = key1;
10856
- // if (
10857
- // word_start_pos &&
10858
- // key1 > word_start_pos &&
10859
- // nonLettersPatt.test(val1) // find any sign character to mark the end of word
10860
- // )
10861
- // word_end_pos = key1;
10862
- // if (word_start_pos && word_start_pos >= 0 && word_end_pos && word_end_pos >= 0) {
10863
- // // find the word
10864
- // var word = val.substr(word_start_pos + 1, word_end_pos - word_start_pos - 1); // get the word
10865
- // // if (glb.ALL_PROPERTIES_ARR.indexOf(word) === -1) {
10866
- // // compare with internal properties
10867
- // tmpStr = tmpStr.substr(0, word_start_pos) + '^^' + tmpStr.substr(word_start_pos, word_end_pos);
10868
- // // }
10869
- // if (val.substr(word_end_pos, 1) === '.') word_start_pos = word_end_pos;
10870
- // else word_start_pos = null;
10871
- // word_end_pos = null;
10872
- // }
10873
- // if (val1 === '[') validSymbols = validSymbolsWithArray;
10874
- // if (nonLettersPatt.test(val1) && validSymbols.test(val1) && tmpStr.indexOf('^^') === -1) {
10875
- // tmpStr += '^^' + val1;
10876
- // } else tmpStr += val1;
10877
- // }
10878
- // // });
10879
- // if (tmpStr.indexOf('^^') > -1) {
10880
- // var obj1 = extract_str(tmpStr, pos);
10881
- // obj = obj.concat(obj1);
10882
- // } else {
10883
- // // push clean @var
10884
- // var fieldId = undefined;
10885
- // if (val) {
10886
- // fieldId = val.substr(1, val.length);
10887
- // if (val.indexOf('.') > -1) fieldId = val.substr(1, val.indexOf('.') - 1);
10888
- // if (val.indexOf('[') > -1) fieldId = val.substr(1, val.indexOf('[') - 1);
10889
- // //
10890
- // // if (val.indexOf("]") > -1)
10891
- // // fieldId = val.substr(1, val.indexOf("]") - 1);
10892
- // }
10893
- // obj.push({
10894
- // value: val,
10895
- // fieldId: fieldId,
10896
- // pos: pos + posP,
10897
- // });
10898
- // }
10899
- // } else {
10900
- // obj.push({
10901
- // value: val,
10902
- // pos: pos + posP,
10903
- // });
10904
- // }
10905
- // }
10906
- // }
10907
- // return obj;
10908
- // }
10909
- // };
10910
- // var res = extract_str(strP);
10911
- // return res;
10912
- // };
10830
+ func.expression.parse_org = function (strP) {
10831
+ var extract_str = function (strP, posP) {
10832
+ if (!posP) posP = 0;
10833
+ var clean_split_str = function (arrP) {
10834
+ var arr = [];
10835
+ if (arrP && arrP.length > 1 && arrP[0] === '' && arrP[1].indexOf('@') > -1) {
10836
+ for (var i = 1; i <= arrP.length; i++) {
10837
+ arr.push(arrP[i]);
10838
+ }
10839
+ return arr;
10840
+ } else return arrP;
10841
+ };
10842
+ var nonLettersPatt = /\W/; // non letters
10843
+ var validSymbolsNoArray = /[^.@\[]/; //valid symbols no array /[^.@\[\]\]]/
10844
+ var validSymbolsWithArray = /[^.@"'\[\]]/; //valid symbols with array
10845
+ var validSymbols = validSymbolsNoArray;
10846
+ var splitTmp = strP.replace(/@/g, '^^@').split('^^');
10847
+ var split = clean_split_str(splitTmp);
10848
+ var obj = [];
10849
+ if (split) {
10850
+ for (let val of split) {
10851
+ // run on @ segments
10852
+ if (val) {
10853
+ var pos = strP.indexOf(val);
10854
+ if (val && val.substr(0, 1) === '@') {
10855
+ var tmpStr = '';
10856
+ var word_start_pos = undefined;
10857
+ var word_end_pos = undefined;
10858
+ // run on @ segment string
10859
+ for (var i = 0; i <= val.length; i++) {
10860
+ var key1 = i;
10861
+ var val1 = val.substr(i, 1);
10862
+ if (
10863
+ val1 === '.' &&
10864
+ !word_start_pos // find first dot
10865
+ )
10866
+ word_start_pos = key1;
10867
+ if (
10868
+ word_start_pos &&
10869
+ key1 > word_start_pos &&
10870
+ nonLettersPatt.test(val1) // find any sign character to mark the end of word
10871
+ )
10872
+ word_end_pos = key1;
10873
+ if (word_start_pos && word_start_pos >= 0 && word_end_pos && word_end_pos >= 0) {
10874
+ // find the word
10875
+ var word = val.substr(word_start_pos + 1, word_end_pos - word_start_pos - 1); // get the word
10876
+ // if (glb.ALL_PROPERTIES_ARR.indexOf(word) === -1) {
10877
+ // compare with internal properties
10878
+ tmpStr = tmpStr.substr(0, word_start_pos) + '^^' + tmpStr.substr(word_start_pos, word_end_pos);
10879
+ // }
10880
+ if (val.substr(word_end_pos, 1) === '.') word_start_pos = word_end_pos;
10881
+ else word_start_pos = null;
10882
+ word_end_pos = null;
10883
+ }
10884
+ if (val1 === '[') validSymbols = validSymbolsWithArray;
10885
+ if (nonLettersPatt.test(val1) && validSymbols.test(val1) && tmpStr.indexOf('^^') === -1) {
10886
+ tmpStr += '^^' + val1;
10887
+ } else tmpStr += val1;
10888
+ }
10889
+ // });
10890
+ if (tmpStr.indexOf('^^') > -1) {
10891
+ var obj1 = extract_str(tmpStr, pos);
10892
+ obj = obj.concat(obj1);
10893
+ } else {
10894
+ // push clean @var
10895
+ var fieldId = undefined;
10896
+ if (val) {
10897
+ fieldId = val.substr(1, val.length);
10898
+ if (val.indexOf('.') > -1) fieldId = val.substr(1, val.indexOf('.') - 1);
10899
+ if (val.indexOf('[') > -1) fieldId = val.substr(1, val.indexOf('[') - 1);
10900
+ //
10901
+ // if (val.indexOf("]") > -1)
10902
+ // fieldId = val.substr(1, val.indexOf("]") - 1);
10903
+ }
10904
+ obj.push({
10905
+ value: val,
10906
+ fieldId: fieldId,
10907
+ pos: pos + posP,
10908
+ });
10909
+ }
10910
+ } else {
10911
+ obj.push({
10912
+ value: val,
10913
+ pos: pos + posP,
10914
+ });
10915
+ }
10916
+ }
10917
+ }
10918
+ return obj;
10919
+ }
10920
+ };
10921
+ var res = extract_str(strP);
10922
+ return res;
10923
+ };
10913
10924
 
10914
- func.expression.parse = function (strP) {
10925
+ func.expression.parse_bad = function (strP) {
10915
10926
  const nonLettersPatt = /\W/;
10916
10927
  const validSymbolsNoArray = /[^.@\[]/;
10917
10928
  const validSymbolsWithArray = /[^.@"'\[\]]/;
@@ -10969,6 +10980,61 @@ func.expression.parse = function (strP) {
10969
10980
  return extractStr(strP);
10970
10981
  };
10971
10982
 
10983
+ func.expression.parse = function (input) {
10984
+ if (typeof input !== 'string') return [];
10985
+
10986
+ const segments = [];
10987
+ let pos = 0;
10988
+
10989
+ const parts = input.split(/(@)/).filter(Boolean);
10990
+
10991
+ for (let i = 0; i < parts.length; i++) {
10992
+ const part = parts[i];
10993
+
10994
+ if (part === '@' && i + 1 < parts.length) {
10995
+ const nextPart = parts[i + 1];
10996
+ const varEnd = nextPart.search(/[.\[]/); // Split at first . or [
10997
+ let fieldId, remainder;
10998
+
10999
+ if (varEnd > 0) {
11000
+ fieldId = nextPart.slice(0, varEnd);
11001
+ remainder = nextPart.slice(varEnd);
11002
+ } else {
11003
+ fieldId = nextPart;
11004
+ remainder = '';
11005
+ }
11006
+
11007
+ // Add @variable segment
11008
+ const fullVarValue = `@${fieldId}`;
11009
+ segments.push({
11010
+ value: fullVarValue,
11011
+ fieldId,
11012
+ pos,
11013
+ });
11014
+ pos += fullVarValue.length;
11015
+
11016
+ // Add remainder as a separate segment, if any
11017
+ if (remainder) {
11018
+ segments.push({
11019
+ value: remainder,
11020
+ pos,
11021
+ });
11022
+ pos += remainder.length;
11023
+ }
11024
+
11025
+ i++; // Skip the next part since we consumed it
11026
+ } else if (part !== '@') {
11027
+ segments.push({
11028
+ value: part,
11029
+ pos,
11030
+ });
11031
+ pos += part.length;
11032
+ }
11033
+ }
11034
+
11035
+ return segments;
11036
+ };
11037
+
10972
11038
  func.expression.get_property = async function (valP) {
10973
11039
  async function secure_eval(val) {
10974
11040
  if (typeof IS_PROCESS_SERVER === 'undefined') {
@@ -5100,6 +5100,15 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5100
5100
  }
5101
5101
  };
5102
5102
 
5103
+ const update_xu_ref = async function () {
5104
+ let _ds_0 = _session.DS_GLB[0];
5105
+ for ([ref_name, val] of Object.entries(_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'])) {
5106
+ if (val.ds.dsSession == dataSource) {
5107
+ func.UI.update_xu_ref(SESSION_ID, dataSource, ref_name);
5108
+ }
5109
+ }
5110
+ };
5111
+
5103
5112
  var fields_changed = [];
5104
5113
  var datasource_changed = [];
5105
5114
  let client_datasource_changes = {};
@@ -5117,6 +5126,7 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5117
5126
  // mechanism to make update directly on the datasource object
5118
5127
  if (record_id === 'datasource_main') {
5119
5128
  _.set(_ds, field_id, value);
5129
+ update_xu_ref();
5120
5130
  continue;
5121
5131
  }
5122
5132
 
@@ -5134,15 +5144,16 @@ func.datasource.update = async function (SESSION_ID, datasource_changes, update_
5134
5144
  await set_fieldComputed_dependencies(dataSource, field_id, null);
5135
5145
 
5136
5146
  // search the field in refs
5137
- let _ds_0 = _session.DS_GLB[0];
5138
- for ([ref_name, val] of Object.entries(_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'])) {
5139
- if (val.ds.dsSession == dataSource) {
5140
- func.UI.update_xu_ref(SESSION_ID, dataSource, ref_name);
5141
- // if (!fields_changed.includes(ref_name)) {
5142
- // fields_changed.push(ref_name);
5143
- // }
5144
- }
5145
- }
5147
+ update_xu_ref();
5148
+ // let _ds_0 = _session.DS_GLB[0];
5149
+ // for ([ref_name, val] of Object.entries(_ds_0.data_system['SYS_GLOBAL_OBJ_REFS'])) {
5150
+ // if (val.ds.dsSession == dataSource) {
5151
+ // func.UI.update_xu_ref(SESSION_ID, dataSource, ref_name);
5152
+ // // if (!fields_changed.includes(ref_name)) {
5153
+ // // fields_changed.push(ref_name);
5154
+ // // }
5155
+ // }
5156
+ // }
5146
5157
 
5147
5158
  if (!update_local_scope_only) {
5148
5159
  let tree_ret = await func.utils.TREE_OBJ.get(SESSION_ID, _ds.prog_id);
@@ -14613,102 +14624,102 @@ func.expression.get = async function (SESSION_ID, valP, dsSessionP, sourceP, row
14613
14624
  return new_class.get();
14614
14625
  };
14615
14626
 
14616
- // func.expression.parse = function (strP) {
14617
- // var extract_str = function (strP, posP) {
14618
- // if (!posP) posP = 0;
14619
- // var clean_split_str = function (arrP) {
14620
- // var arr = [];
14621
- // if (arrP && arrP.length > 1 && arrP[0] === '' && arrP[1].indexOf('@') > -1) {
14622
- // for (var i = 1; i <= arrP.length; i++) {
14623
- // arr.push(arrP[i]);
14624
- // }
14625
- // return arr;
14626
- // } else return arrP;
14627
- // };
14628
- // var nonLettersPatt = /\W/; // non letters
14629
- // var validSymbolsNoArray = /[^.@\[]/; //valid symbols no array /[^.@\[\]\]]/
14630
- // var validSymbolsWithArray = /[^.@"'\[\]]/; //valid symbols with array
14631
- // var validSymbols = validSymbolsNoArray;
14632
- // var splitTmp = strP.replace(/@/g, '^^@').split('^^');
14633
- // var split = clean_split_str(splitTmp);
14634
- // var obj = [];
14635
- // if (split) {
14636
- // for (let val of split) {
14637
- // // run on @ segments
14638
- // if (val) {
14639
- // var pos = strP.indexOf(val);
14640
- // if (val && val.substr(0, 1) === '@') {
14641
- // var tmpStr = '';
14642
- // var word_start_pos = undefined;
14643
- // var word_end_pos = undefined;
14644
- // // run on @ segment string
14645
- // for (var i = 0; i <= val.length; i++) {
14646
- // var key1 = i;
14647
- // var val1 = val.substr(i, 1);
14648
- // if (
14649
- // val1 === '.' &&
14650
- // !word_start_pos // find first dot
14651
- // )
14652
- // word_start_pos = key1;
14653
- // if (
14654
- // word_start_pos &&
14655
- // key1 > word_start_pos &&
14656
- // nonLettersPatt.test(val1) // find any sign character to mark the end of word
14657
- // )
14658
- // word_end_pos = key1;
14659
- // if (word_start_pos && word_start_pos >= 0 && word_end_pos && word_end_pos >= 0) {
14660
- // // find the word
14661
- // var word = val.substr(word_start_pos + 1, word_end_pos - word_start_pos - 1); // get the word
14662
- // // if (glb.ALL_PROPERTIES_ARR.indexOf(word) === -1) {
14663
- // // compare with internal properties
14664
- // tmpStr = tmpStr.substr(0, word_start_pos) + '^^' + tmpStr.substr(word_start_pos, word_end_pos);
14665
- // // }
14666
- // if (val.substr(word_end_pos, 1) === '.') word_start_pos = word_end_pos;
14667
- // else word_start_pos = null;
14668
- // word_end_pos = null;
14669
- // }
14670
- // if (val1 === '[') validSymbols = validSymbolsWithArray;
14671
- // if (nonLettersPatt.test(val1) && validSymbols.test(val1) && tmpStr.indexOf('^^') === -1) {
14672
- // tmpStr += '^^' + val1;
14673
- // } else tmpStr += val1;
14674
- // }
14675
- // // });
14676
- // if (tmpStr.indexOf('^^') > -1) {
14677
- // var obj1 = extract_str(tmpStr, pos);
14678
- // obj = obj.concat(obj1);
14679
- // } else {
14680
- // // push clean @var
14681
- // var fieldId = undefined;
14682
- // if (val) {
14683
- // fieldId = val.substr(1, val.length);
14684
- // if (val.indexOf('.') > -1) fieldId = val.substr(1, val.indexOf('.') - 1);
14685
- // if (val.indexOf('[') > -1) fieldId = val.substr(1, val.indexOf('[') - 1);
14686
- // //
14687
- // // if (val.indexOf("]") > -1)
14688
- // // fieldId = val.substr(1, val.indexOf("]") - 1);
14689
- // }
14690
- // obj.push({
14691
- // value: val,
14692
- // fieldId: fieldId,
14693
- // pos: pos + posP,
14694
- // });
14695
- // }
14696
- // } else {
14697
- // obj.push({
14698
- // value: val,
14699
- // pos: pos + posP,
14700
- // });
14701
- // }
14702
- // }
14703
- // }
14704
- // return obj;
14705
- // }
14706
- // };
14707
- // var res = extract_str(strP);
14708
- // return res;
14709
- // };
14627
+ func.expression.parse_org = function (strP) {
14628
+ var extract_str = function (strP, posP) {
14629
+ if (!posP) posP = 0;
14630
+ var clean_split_str = function (arrP) {
14631
+ var arr = [];
14632
+ if (arrP && arrP.length > 1 && arrP[0] === '' && arrP[1].indexOf('@') > -1) {
14633
+ for (var i = 1; i <= arrP.length; i++) {
14634
+ arr.push(arrP[i]);
14635
+ }
14636
+ return arr;
14637
+ } else return arrP;
14638
+ };
14639
+ var nonLettersPatt = /\W/; // non letters
14640
+ var validSymbolsNoArray = /[^.@\[]/; //valid symbols no array /[^.@\[\]\]]/
14641
+ var validSymbolsWithArray = /[^.@"'\[\]]/; //valid symbols with array
14642
+ var validSymbols = validSymbolsNoArray;
14643
+ var splitTmp = strP.replace(/@/g, '^^@').split('^^');
14644
+ var split = clean_split_str(splitTmp);
14645
+ var obj = [];
14646
+ if (split) {
14647
+ for (let val of split) {
14648
+ // run on @ segments
14649
+ if (val) {
14650
+ var pos = strP.indexOf(val);
14651
+ if (val && val.substr(0, 1) === '@') {
14652
+ var tmpStr = '';
14653
+ var word_start_pos = undefined;
14654
+ var word_end_pos = undefined;
14655
+ // run on @ segment string
14656
+ for (var i = 0; i <= val.length; i++) {
14657
+ var key1 = i;
14658
+ var val1 = val.substr(i, 1);
14659
+ if (
14660
+ val1 === '.' &&
14661
+ !word_start_pos // find first dot
14662
+ )
14663
+ word_start_pos = key1;
14664
+ if (
14665
+ word_start_pos &&
14666
+ key1 > word_start_pos &&
14667
+ nonLettersPatt.test(val1) // find any sign character to mark the end of word
14668
+ )
14669
+ word_end_pos = key1;
14670
+ if (word_start_pos && word_start_pos >= 0 && word_end_pos && word_end_pos >= 0) {
14671
+ // find the word
14672
+ var word = val.substr(word_start_pos + 1, word_end_pos - word_start_pos - 1); // get the word
14673
+ // if (glb.ALL_PROPERTIES_ARR.indexOf(word) === -1) {
14674
+ // compare with internal properties
14675
+ tmpStr = tmpStr.substr(0, word_start_pos) + '^^' + tmpStr.substr(word_start_pos, word_end_pos);
14676
+ // }
14677
+ if (val.substr(word_end_pos, 1) === '.') word_start_pos = word_end_pos;
14678
+ else word_start_pos = null;
14679
+ word_end_pos = null;
14680
+ }
14681
+ if (val1 === '[') validSymbols = validSymbolsWithArray;
14682
+ if (nonLettersPatt.test(val1) && validSymbols.test(val1) && tmpStr.indexOf('^^') === -1) {
14683
+ tmpStr += '^^' + val1;
14684
+ } else tmpStr += val1;
14685
+ }
14686
+ // });
14687
+ if (tmpStr.indexOf('^^') > -1) {
14688
+ var obj1 = extract_str(tmpStr, pos);
14689
+ obj = obj.concat(obj1);
14690
+ } else {
14691
+ // push clean @var
14692
+ var fieldId = undefined;
14693
+ if (val) {
14694
+ fieldId = val.substr(1, val.length);
14695
+ if (val.indexOf('.') > -1) fieldId = val.substr(1, val.indexOf('.') - 1);
14696
+ if (val.indexOf('[') > -1) fieldId = val.substr(1, val.indexOf('[') - 1);
14697
+ //
14698
+ // if (val.indexOf("]") > -1)
14699
+ // fieldId = val.substr(1, val.indexOf("]") - 1);
14700
+ }
14701
+ obj.push({
14702
+ value: val,
14703
+ fieldId: fieldId,
14704
+ pos: pos + posP,
14705
+ });
14706
+ }
14707
+ } else {
14708
+ obj.push({
14709
+ value: val,
14710
+ pos: pos + posP,
14711
+ });
14712
+ }
14713
+ }
14714
+ }
14715
+ return obj;
14716
+ }
14717
+ };
14718
+ var res = extract_str(strP);
14719
+ return res;
14720
+ };
14710
14721
 
14711
- func.expression.parse = function (strP) {
14722
+ func.expression.parse_bad = function (strP) {
14712
14723
  const nonLettersPatt = /\W/;
14713
14724
  const validSymbolsNoArray = /[^.@\[]/;
14714
14725
  const validSymbolsWithArray = /[^.@"'\[\]]/;
@@ -14766,6 +14777,61 @@ func.expression.parse = function (strP) {
14766
14777
  return extractStr(strP);
14767
14778
  };
14768
14779
 
14780
+ func.expression.parse = function (input) {
14781
+ if (typeof input !== 'string') return [];
14782
+
14783
+ const segments = [];
14784
+ let pos = 0;
14785
+
14786
+ const parts = input.split(/(@)/).filter(Boolean);
14787
+
14788
+ for (let i = 0; i < parts.length; i++) {
14789
+ const part = parts[i];
14790
+
14791
+ if (part === '@' && i + 1 < parts.length) {
14792
+ const nextPart = parts[i + 1];
14793
+ const varEnd = nextPart.search(/[.\[]/); // Split at first . or [
14794
+ let fieldId, remainder;
14795
+
14796
+ if (varEnd > 0) {
14797
+ fieldId = nextPart.slice(0, varEnd);
14798
+ remainder = nextPart.slice(varEnd);
14799
+ } else {
14800
+ fieldId = nextPart;
14801
+ remainder = '';
14802
+ }
14803
+
14804
+ // Add @variable segment
14805
+ const fullVarValue = `@${fieldId}`;
14806
+ segments.push({
14807
+ value: fullVarValue,
14808
+ fieldId,
14809
+ pos,
14810
+ });
14811
+ pos += fullVarValue.length;
14812
+
14813
+ // Add remainder as a separate segment, if any
14814
+ if (remainder) {
14815
+ segments.push({
14816
+ value: remainder,
14817
+ pos,
14818
+ });
14819
+ pos += remainder.length;
14820
+ }
14821
+
14822
+ i++; // Skip the next part since we consumed it
14823
+ } else if (part !== '@') {
14824
+ segments.push({
14825
+ value: part,
14826
+ pos,
14827
+ });
14828
+ pos += part.length;
14829
+ }
14830
+ }
14831
+
14832
+ return segments;
14833
+ };
14834
+
14769
14835
  func.expression.get_property = async function (valP) {
14770
14836
  async function secure_eval(val) {
14771
14837
  if (typeof IS_PROCESS_SERVER === 'undefined') {