瀏覽代碼

Fixed issue https://github.com/marcobambini/gravity/issues/117

Marco Bambini 8 年之前
父節點
當前提交
d24fa50d12
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/compiler/gravity_parser.c

+ 3 - 0
src/compiler/gravity_parser.c

@@ -686,6 +686,9 @@ static gnode_t *parse_analyze_literal_string (gravity_parser_t *parser, gtoken_s
 	}
 	}
 	
 	
 return_string:
 return_string:
+	// append the last string if any and if interpolation mode is on
+	if (r && length) gnode_array_push(r, gnode_literal_string_expr_create(token, buffer, length, true));
+	
 	// return a node (even in case of error) so its memory will be automatically freed
 	// return a node (even in case of error) so its memory will be automatically freed
 	return (r) ? gnode_string_interpolation_create(token, r) : gnode_literal_string_expr_create(token, buffer, length, true);
 	return (r) ? gnode_string_interpolation_create(token, r) : gnode_literal_string_expr_create(token, buffer, length, true);
 }
 }