lsa-pucrs / donnie-assistive-robot-sw

Donnie's software (Arduino Firmware, Player Drivers, Stage simulation models, RPi software)
http://donnie-manual.readthedocs.io
GNU General Public License v3.0
6 stars 0 forks source link

Comando criar - variáveis com nomes de comandos - prevenção de erros #98

Open julianadamasio opened 7 years ago

julianadamasio commented 7 years ago

O correto é não permitir criar variáveis com nomes de comandos da linguagem. Deve ser informado ao usuário q distancia variavelsom

ue é uma palavra reservada da linguagem.

edutra commented 6 years ago

Solved. Waiting for review. @amamory

amamory commented 5 years ago

The following sequence of commands shows that it is not working. The variable xuxu and xuxa were not created.

$ GoDonnie -t playerc warning : warning : [Player v.3.0.2] connected on [localhost:6665] with sock 3

GoDonnie$ criar xuxu = 2 GoDonnie$ criar xuxu = 2 Tree : criar (= xuxu 2) Error in line 1 , in column 6. Verify command xuxu

GoDonnie$ GoDonnie$ som desligado GoDonnie$ som desligado Tree : som desligado GoDonnie$ falar xuxu GoDonnie$ falar xuxu Tree : (falar xuxu) Variable "xuxu" doesn't exist. Variable "xuxu" doesn't exist. SPEAK: 0 0 GoDonnie$ criar xuxu GoDonnie$ criar xuxa GoDonnie$ xuxa = 2 GoDonnie$ falar xuxa GoDonnie$ criar xuxu criar xuxa xuxa = 2 falar xuxa Tree : criar Tree Error Node Tree Error Node criar Tree Error Node Tree Error Node (= xuxa 2) (falar xuxa) Error in line 1 , in column 6. Verify command xuxu Error in line 2 , in column 7. Verify command xuxa

Error in line 1 , in column 6. Verify command xuxu Error in line 2 , in column 7. Verify command xuxa

GoDonnie$ criar xuxa GoDonnie$ criar xuxa Tree : criar Tree Error Node Tree Error Node Error in line 1 , in column 6. Verify command xuxa

Error in line 1 , in column 6. Verify command xuxa

GoDonnie$ falar xuxa GoDonnie$ falar xuxa Tree : (falar xuxa) Variable "xuxa" doesn't exist. Variable "xuxa" doesn't exist. SPEAK: 0 0

edutra commented 5 years ago

Fixed!!!

`donnie@donnie-VirtualBox:~/donnie/donnie-assistive-robot-sw/build$ GoDonnie -t
playerc warning   : warning : [Player v.3.0.2] connected on [localhost:6665] with sock 3

GoDonnie$ criar xuxu
GoDonnie$ criar xuxa
GoDonnie$ som desligado
GoDonnie$ xuxu = 3
GoDonnie$ xuxa = 3
GoDonnie$ falar xuxu
GoDonnie$ xuxa = 56
GoDonnie$ falar xuxa
GoDonnie$ criar y = xuxu + xuxa
GoDonnie$ criar xuxu
criar xuxa
som desligado
xuxu = 3
xuxa = 3
falar xuxu
xuxa = 56
falar xuxa
criar y = xuxu + xuxa
3
56
GoDonnie$ falar y
GoDonnie$ falar y
59
GoDonnie$ criar som = 3
GoDonnie$ criar som = 3
Error in line 1 , column 9.  Invalid word 
Error in line 1 , in column 12. Verify command 3

Error in line 1 , in column 12. Verify command 3

GoDonnie$ criar cinto
GoDonnie$ criar cinto
Error in line 1 , in column 6. Verify command cinto

Error in line 1 , in column 6. Verify command cinto

GoDonnie$ criar cor = "Vermelho"
GoDonnie$ criar cor = "Vermelho"
Error in line 1 , column 9.  Invalid word 
Error in line 1 , in column 12. Verify command "Vermelho"

Error in line 1 , in column 12. Verify command "Vermelho"
`