thejoeejoee / VUT-FIT-IFJ-2017-toolkit

IDE for custom language IFJcode17 and pack of automatic tests for compilers of that language.
https://ifj.josefkolar.cz/
GNU General Public License v3.0
23 stars 11 forks source link

Nekonzistencia s ic17int pri opakovanom DEFVAR #71

Closed cvb941 closed 6 years ago

cvb941 commented 6 years ago

Oficialny interpret pri reDEFVARovani ohlasi chybu "Symbol already exists!", zatial co tento interpret nie.

Toto spravanie je klucove pri loopoch, ako napriklad while, kde sa zapisane prikazy vykonavaju viac krat. Tym padom, ak su v tele while zapisane DEFVARy tak pri cykle, ktory sa vykona viac ako raz, nastane na oficialnom interpretri chyba, ktoru tento interpret neodhali.

Testovatelne na tomto kode:

.IFJcode17
DEFVAR GF@$return
JUMP %main

LABEL %main
CREATEFRAME

DEFVAR TF@count
MOVE TF@count int@0

LABEL $label1
DEFVAR TF@$temp1
LT TF@$temp1 TF@count int@5
JUMPIFNEQ $label2 TF@$temp1 bool@true

WRITE TF@count

DEFVAR TF@$temp2
ADD TF@$temp2 TF@count int@1
MOVE TF@count TF@$temp2

JUMP $label1
LABEL $label2
thejoeejoee commented 6 years ago

Opraveno do 1.4.12, jestliže je OK, zavři prosím.