SLabuz95 / TclToTextFileGenerator

0 stars 0 forks source link

Sign # in case of wrong place shall not generate error #22

Open SLabuz95 opened 2 years ago

SLabuz95 commented 2 years ago

Initial idea

In case of sign # in unexpected state of parser, parser shall:

SLabuz95 commented 2 years ago

Introduction

In most of cases, comment sign # without end of procedure call sign ; isn't intended action. User probably want to write single line comment for procedure call in that line.

User probably dont know that:

If you want to write a comment after procedure call, you have to add end of procedure call sign ; like in example below:

image

In this case, you will call procedure concat with 1 string argument abc. If you dont write this sign, then comment sign # and everything after that sign will be interpreted as string argument.

image

or

image

As a result, you will call procedure concat with 4 or 3 string arguments.

Current Application Concept

Current application's assumption:

User will never use comment sign # as argument for procedure call.

Current behaviour:

The interpreter doesnt know how to act in this situation and throw the error (Unknown stat error). As a result, interpreter ignores whole procedure call and comment.

Change request

Description

In case of comment sign '#' without end of expression sign ';' :

Beside that user shall have possibility to choose how to generate this incorrect procedure call in the interpreter configuration panel:

Reason

More user-friendly interpreter, less errors.

Verdict

Approved

Reason

The application is more user friendly, cause let user slide.

State

In development

Implementation plan

  1. Specify, which states can cause the issue at procedure for sign #.
  2. Develop an alogithm:
  3. Add variables (list of strings - blacklisted strings + boolean flag - type of reaction on an event + mark string) to configuration class.
  4. Modify definitions list in the input panel to take and control black listed string. Additionally line edit for mark generated by interpreter and check box to choose type of reaction on an event.
  5. Integrate black list panel with configuration (prepare configuration on generation startup).

Implementation details

  1. List of states:

  2. Algorithm:

  3. New variables: