Skip to content
Snippets Groups Projects
Commit 1b812d94 authored by marivil's avatar marivil
Browse files

Incluidos valores lógicos estilo C.

parent 423ab6af
No related branches found
No related tags found
1 merge request!1Arbol
......@@ -53,7 +53,7 @@ unsigned keycodes[KWLEN] = {
TAN,
VAR,
WHILE,
DO
DO,
};
static void lower(char *s);
......@@ -115,6 +115,18 @@ COMMULT "/*"([^*]|\*+[^*/])*\*+"/"
char *res;
//lower(yytext); Lenguaje case-sensitive
//Valores logicos
if(strcmp(yytext,"true") == 0 ){
yyFloat(yylval) = 1;
yyFlag(yylval) = fFLOAT;
return FLOAT;
}else if (strcmp(yytext,"false") == 0){
yyFloat(yylval) = 0;
yyFlag(yylval) = fFLOAT;
return FLOAT;
}
//Palabras clave
for (i = 0; i<KWLEN; i++ ){
......
......@@ -7,6 +7,14 @@ NJpasds
var x_ = 5;
var x_ += 2;
print(x_);
dasd
var x1 = true;
if (true)
{
print("Hola \n");
if (!false)
{
print("Caracola \n");
}
}
print(x1);
/* HOLA PUTA*/
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment