Skip to content
Snippets Groups Projects
Commit f5cbf9d8 authored by CLAVEL JULIEN's avatar CLAVEL JULIEN
Browse files

fixed printstr limitation now can go up to 1023 chars

parent f095cb8c
Branches
1 merge request!12print 20 floars per line in print_print case ARRAY
......@@ -81,8 +81,8 @@ in {return in_dom;}
["]([^"]|[\\]["])*["] {
if ( yyleng > 1023 )
fprintf(stderr,"Error at line %u: Identifier '%s' too long (> 1023), truncated\n",lineNumber,yytext);
strncpy(yylval.strval,yytext,1023);
yylval.strval[1024] = '\0';
strncpy(yylval.chain,yytext,1023);
yylval.chain[1023] = '\0';
return chaine;
}
......
......@@ -35,6 +35,7 @@ void exit_safely(){
long int intval;
float floatval;
name_t strval;
name_64_t chain;
struct {
struct symbol* ptr;
......@@ -75,7 +76,7 @@ void exit_safely(){
%token <strval> ID1
%token <strval> ID2
%token <strval> chaine
%token <chain> chaine
%token <intval> entier
%token <floatval> flottant
......
......@@ -23,6 +23,8 @@ struct array {
struct symbol* dim1size;
};
enum var_type{
INTEGER, // -> the var is an INTEGER
FLOAT // -> the var is a FLOAT
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment