Opened 5 years ago

#49 new enhancement

Allow manual reference checking

Reported by: Mateusz Poszwa Owned by: Mateusz Poszwa
Priority: major Milestone:
Component: framclipse Version:
Keywords: Cc:


Framclipse tries its best to detect as many errors as possible,
while accepting correct code.
However, it is sometimes not possible to prove a certain statement is correct.

Example (taken from standard-mt.expdef):

var s = Simulator.slaves[i];
var fromslave = s.export(null, 2, 0, 0);
Simulator.import("string://" + fromslave, 2 + 128);
ExpState.totaltestedcr += s.expstate.totaltestedcr;
ExpState.totaltests += s.expstate.totaltests;

In the example above, it is impossible to tell whether the references
in the right sides of the last two lines are correct
without evaluating fromslave, which might be impossible.
Framscript should issue a warning in this case.
If many such warnings are present, the important ones may be hard to spot.

One of the solutions is to allow exclusion of such dubious statements
from error checking process if they have been verified by the user.
To facilitate this, it has been suggested to introduce the following directives:

@annotate framclipse mute errors next line
@annotate framclipse mute errors begin
@annotate framclipse mute errors end

These directives would exclude single lines or blocks of code from reference checking.

Technically, it can be done by stripping the field references in the auxiliary lexer so, for example,

var x = s.expstate.["totaltestedcr"];

is interpreted as

var x = s;

which is a valid piece of code (defining x like it used to),
and at the same time doesn’t contain potentially invalid references.

Change History (0)

Note: See TracTickets for help on using tickets.