@freelog/freelog-cg-collection 1.0.12 → 1.0.13

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.
@@ -188,9 +188,9 @@ class CollectionPolicyCustomVisitor extends CollectionPolicyVisitor {
188
188
  varValueObj: this.visitAssignment_clause(ctx.variable_assignment().assignment_clause())
189
189
  };
190
190
 
191
- if (this.varDeclarationMap.has(assignmentElem.varName)) {
192
- throw new Error(`全局变量不可以被再次赋值 --- ${assignmentElem.varName}`);
193
- }
191
+ // if (this.varDeclarationMap.has(assignmentElem.varName)) {
192
+ // throw new Error(`全局变量不可以被再次赋值 --- ${assignmentElem.varName}`);
193
+ // }
194
194
  if (this.currentStateObj["assignments"].find(elem => {
195
195
  return elem.varName === assignmentElem.varName;
196
196
  }) == null) {
@@ -224,6 +224,9 @@ class CollectionPolicyCustomVisitor extends CollectionPolicyVisitor {
224
224
  if (this.varDeclarationMap.has(assignmentElem.varName)) {
225
225
  throw new Error(`局部变量不可以和全局变量同名 --- ${assignmentElem.varName}`);
226
226
  }
227
+ if (this.currentStateObj["stateContextArgs"].indexOf(assignmentElem.varName) !== -1) {
228
+ throw new Error(`局部变量不可以和状态环境参数同名 --- ${assignmentElem.varName}`)
229
+ }
227
230
  if (this.currentStateObj["assignments"].find(elem => {
228
231
  return elem.varName === assignmentElem.varName;
229
232
  }) != null) {
@@ -280,12 +283,12 @@ class CollectionPolicyCustomVisitor extends CollectionPolicyVisitor {
280
283
  }
281
284
 
282
285
  if (ctx.state_context_args_section_at_event() != null) {
283
- this.currentEventElem["stateContextArgs"] = ctx.state_context_args_section_at_event().variable_assignment().map(elem => {
286
+ this.currentEventElem["stateContextArgs"] = ctx.state_context_args_section_at_event().sc_args_at_event_param().map(elem => {
284
287
  this.parseState.inContextArgsSectionAtEvent = 1;
285
288
  let paramElem = {
286
- paramName: elem.ID().getText(),
287
- paramValue: elem.assignment_clause().getText(),
288
- paramValueObj: this.visitAssignment_clause(elem.assignment_clause()),
289
+ paramName: elem.sc_args_at_event_param_name().getText(),
290
+ paramValue: elem.sc_args_at_event_param_value().assignment_clause().getText(),
291
+ paramValueObj: this.visitAssignment_clause(elem.sc_args_at_event_param_value().assignment_clause()),
289
292
  content: elem.getText()
290
293
  };
291
294
  this.parseState.inContextArgsSectionAtEvent = 0;
@@ -293,7 +296,7 @@ class CollectionPolicyCustomVisitor extends CollectionPolicyVisitor {
293
296
  if (paramElem["paramValueObj"]["expType"] === "variableChain"
294
297
  && context_variables.indexOf(paramElem["paramValue"]) === -1
295
298
  && !this.varDeclarationMap.has(paramElem["paramValue"])
296
- && this.currentStateObj["stateContextArgs"].find(sca => `contextArgs.${sca}` === paramElem["paramValue"]) == null
299
+ && this.currentStateObj["stateContextArgs"].indexOf(paramElem["paramValue"]) === -1
297
300
  && this.currentStateObj["assignments"].find(assignment => assignment.varName === paramElem["paramValue"]) == null
298
301
  && event_configParamList.find(event_configParam => {
299
302
  if (event_configParam["type"] === "argsGroup") {
@@ -254,6 +254,33 @@ CollectionPolicyListener.prototype.exitState_context_args_section_at_event = fun
254
254
  };
255
255
 
256
256
 
257
+ // Enter a parse tree produced by CollectionPolicyParser#sc_args_at_event_param.
258
+ CollectionPolicyListener.prototype.enterSc_args_at_event_param = function(ctx) {
259
+ };
260
+
261
+ // Exit a parse tree produced by CollectionPolicyParser#sc_args_at_event_param.
262
+ CollectionPolicyListener.prototype.exitSc_args_at_event_param = function(ctx) {
263
+ };
264
+
265
+
266
+ // Enter a parse tree produced by CollectionPolicyParser#sc_args_at_event_param_name.
267
+ CollectionPolicyListener.prototype.enterSc_args_at_event_param_name = function(ctx) {
268
+ };
269
+
270
+ // Exit a parse tree produced by CollectionPolicyParser#sc_args_at_event_param_name.
271
+ CollectionPolicyListener.prototype.exitSc_args_at_event_param_name = function(ctx) {
272
+ };
273
+
274
+
275
+ // Enter a parse tree produced by CollectionPolicyParser#sc_args_at_event_param_value.
276
+ CollectionPolicyListener.prototype.enterSc_args_at_event_param_value = function(ctx) {
277
+ };
278
+
279
+ // Exit a parse tree produced by CollectionPolicyParser#sc_args_at_event_param_value.
280
+ CollectionPolicyListener.prototype.exitSc_args_at_event_param_value = function(ctx) {
281
+ };
282
+
283
+
257
284
  // Enter a parse tree produced by CollectionPolicyParser#action_section.
258
285
  CollectionPolicyListener.prototype.enterAction_section = function(ctx) {
259
286
  };