}
public override void visit_string_literal (StringLiteral expr) {
- expr.ccodenode = new CCodeConstant.string (expr.value);
+ expr.ccodenode = new CCodeConstant.string (expr.value.replace ("\n", "\\n"));
}
public override void visit_regex_literal (RegexLiteral expr) {
break;
}
} else if (current[0] == '\n') {
- break;
+ current++;
+ line++;
+ column = 1;
+ token_length_in_chars = 1;
} else {
unichar u = ((string) current).get_char_validated ((long) (end - current));
if (u != (unichar) (-1)) {
}
}
}
- if (current >= end || current[0] == '\n') {
+ if (current >= end) {
Report.error (new SourceReference (source_file, line, column + token_length_in_chars, line, column + token_length_in_chars), "syntax error, expected \"");
state_stack.length--;
return read_token (out token_begin, out token_end);
break;
}
} else if (current[0] == '\n') {
- break;
+ current++;
+ line++;
+ column = 1;
+ token_length_in_chars = 1;
} else {
if (type == TokenType.STRING_LITERAL && source_file.context.profile == Profile.DOVA && current[0] == '$') {
// string template
}
}
}
- if (current < end && current[0] != '\n') {
+ if (current < end) {
current++;
} else {
Report.error (new SourceReference (source_file, line, column + token_length_in_chars, line, column + token_length_in_chars), "syntax error, expected %c".printf (begin[0]));