changelog for the upcoming V 0.1.19

pull/1714/head
Alexander Medvednikov 2019-08-23 00:26:59 +03:00
parent f61b14584a
commit 6c6cbe0821
3 changed files with 98 additions and 82 deletions

View File

@ -1,3 +1,24 @@
## V 0.1.19
*XX Aug 2019*
- New `mysql` module.
- Better error format that is supported by all major editors (go to error).
- Raw json fields via the `[raw]` attribute.
- `import const` was removed from the language.
- All C code was removed from the `freetype` module.
- `[typedef] attribute for imported C struct typedefs.
- Support of Objective C interfaces (primarily for using Cocoa).
- REPL: clear command and custom functions.
- Syntax bug fixed: `foo[0] += 10` is now possible.
- http: support plain HTTP protocol and follow redirects.
- net: basic UDP support.
- Functions can now be inlined via the `[inline]` attribute.
## V 0.1.18 ## V 0.1.18
*16 Aug 2019* *16 Aug 2019*

View File

@ -13,7 +13,6 @@ CommonCHeaders = '
#define STRUCT_DEFAULT_VALUE {} #define STRUCT_DEFAULT_VALUE {}
#define EMPTY_STRUCT_DECLARATION #define EMPTY_STRUCT_DECLARATION
#define EMPTY_STRUCT_INIT 0
#define OPTION_CAST(x) (x) #define OPTION_CAST(x) (x)
#ifdef _WIN32 #ifdef _WIN32
@ -36,8 +35,6 @@ CommonCHeaders = '
#define STRUCT_DEFAULT_VALUE {0} #define STRUCT_DEFAULT_VALUE {0}
#undef EMPTY_STRUCT_DECLARATION #undef EMPTY_STRUCT_DECLARATION
#define EMPTY_STRUCT_DECLARATION void *____dummy_variable; #define EMPTY_STRUCT_DECLARATION void *____dummy_variable;
#undef EMPTY_STRUCT_INIT
#define EMPTY_STRUCT_INIT 0
#undef OPTION_CAST #undef OPTION_CAST
#define OPTION_CAST(x) #define OPTION_CAST(x)
#endif #endif

View File

@ -2774,10 +2774,10 @@ fn (p mut Parser) array_init() string {
} }
p.gen(' })') p.gen(' })')
// p.gen('$new_arr($vals.len, $vals.len, sizeof($typ), ($typ[]) $c_arr );') // p.gen('$new_arr($vals.len, $vals.len, sizeof($typ), ($typ[]) $c_arr );')
// TODO why need !first_pass()?? Otherwise it goes to the very top of the out.c file // Need to do this in the second pass, otherwise it goes to the very top of the out.c file
if !p.first_pass() { if !p.first_pass() {
if i == 0 { if i == 0 {
p.cgen.set_placeholder(new_arr_ph, '$new_arr($i, $i, sizeof($typ), ($typ[]) {EMPTY_STRUCT_INIT ') p.cgen.set_placeholder(new_arr_ph, '$new_arr($i, $i, sizeof($typ), ($typ[]) { 0 ')
} else { } else {
p.cgen.set_placeholder(new_arr_ph, '$new_arr($i, $i, sizeof($typ), ($typ[]) { ') p.cgen.set_placeholder(new_arr_ph, '$new_arr($i, $i, sizeof($typ), ($typ[]) { ')
} }
@ -2926,11 +2926,9 @@ fn (p mut Parser) struct_init(typ string, is_c_struct_init bool) string {
} }
did_gen_something = true did_gen_something = true
} }
if !did_gen_something { if !did_gen_something {
p.gen('EMPTY_STRUCT_INIT') p.gen('0')
} }
p.gen('}') p.gen('}')
if ptr { if ptr {
p.gen(')') p.gen(')')