Skip to main content
added 371 characters in body
Source Link
SylvainD
  • 29.8k
  • 1
  • 49
  • 93

As far as I can understand

default:    comment.replace(i, 0, "\\");

makes

case '\\':  comment.replace(i, 0, "\\"); break;

useless.

Edit to add another comment :

Please activate all warnings on your code on one hand and on the generated code on the other hand. I think that :

void comment(int line, struct machine_state *m, const char *comment) {\n\
    return;\n\
    fprintf(stderr, \"%d %s\", line, comment);\n\
}\n\

shoud eventually warn you about unreachable code.

As far as I can understand

default:    comment.replace(i, 0, "\\");

makes

case '\\':  comment.replace(i, 0, "\\"); break;

useless.

As far as I can understand

default:    comment.replace(i, 0, "\\");

makes

case '\\':  comment.replace(i, 0, "\\"); break;

useless.

Edit to add another comment :

Please activate all warnings on your code on one hand and on the generated code on the other hand. I think that :

void comment(int line, struct machine_state *m, const char *comment) {\n\
    return;\n\
    fprintf(stderr, \"%d %s\", line, comment);\n\
}\n\

shoud eventually warn you about unreachable code.

Notice removed Needs detailed answers by Jamal
added 4 characters in body
Source Link
Jamal
  • 35.2k
  • 13
  • 134
  • 238

As far as I can understand

default: comment.replace(i, 0, "\\");

default:    comment.replace(i, 0, "\\");

makes

case '\\': comment.replace(i, 0, "\\"); break;

case '\\':  comment.replace(i, 0, "\\"); break;

useless.

As far as I can understand

default: comment.replace(i, 0, "\\");

makes

case '\\': comment.replace(i, 0, "\\"); break;

useless.

As far as I can understand

default:    comment.replace(i, 0, "\\");

makes

case '\\':  comment.replace(i, 0, "\\"); break;

useless.

added 7 characters in body
Source Link
SylvainD
  • 29.8k
  • 1
  • 49
  • 93

As far as I can understand,  

default: comment.replace(i, 0, "\\"); 

makes   

case '\\': comment.replace(i, 0, "\\"); break; 

useless.

As far as I can understand, default: comment.replace(i, 0, "\\"); makes  case '\\': comment.replace(i, 0, "\\"); break; useless.

As far as I can understand 

default: comment.replace(i, 0, "\\"); 

makes 

case '\\': comment.replace(i, 0, "\\"); break; 

useless.

Notice added Needs detailed answers by Jamal
Source Link
SylvainD
  • 29.8k
  • 1
  • 49
  • 93
Loading