Opened 21 years ago
Closed 21 years ago
#40 closed defect (invalid)
Parser mistakes when the code contains a Struct that hasn´t been defined previously
Reported by: | imendez | Owned by: | danirus |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Kernel | Version: | head |
Severity: | normal | Keywords: | |
Cc: |
Description
In the code:
Real a = 4;
Set sPartSim = PartidoSimuladoSt[[ "VLL", "VAL", -2.0000, 1.0000 ? ]];
Real b = 5;
the parser returns a writing error:
ERROR: Argumento SetOfAnything fuera de lugar en línea 2 y columna 36:
LINEA
2 > Real a = 4;
3 : Set sPartSim = PartidoSimuladoSt[[ "VLL", "VAL", -2.0000, 1.0000 ? ]];
4 : Real b = 5;
5 :
Curiously, If you write it with parenthesis '()' instead of double hooks '[]', the
parser does what it should do, showing an error like this:
ERROR: PartidoSimuladoSt no es un operador de tipo Anything
ERROR: Argumentos erróneos para Set SetOfAnything (Anything var1 [, Anything
var2, ...])
ERROR: sPartSim no se pudo crear.
and finally, if you use double hooks '[]' when employing a Struct but you define it
previously, the parser does not show any mistake
The question is: must be possible to write a Struct with double hooks '[]'?
Change History (2)
comment:1 Changed 21 years ago by
Status: | new → assigned |
---|
comment:2 Changed 21 years ago by
Resolution: | → invalid |
---|---|
Status: | assigned → closed |
This is not an error. You must define PartidoSimuladosSt first, as a Struct, and then you can
use it. In fact, once you have defined that Struct, it belongs to Parser Token Table.
This is most important reason because you can not use that sentence to create an instance
of that Struct in:
Set sPartSim = PartidoSimuladoSt[[ "VLL", "VAL", -2.0000, 1.0000 ? ]];
I see also that Parser shows bad messages; it has been resolved yet.