Allow initialization of variables associated with property declaration.
[COMPILER] * NEW: Allow initialization of variables associated with property declaration. * BUG: Correctly detect help comments in all cases.
This commit is contained in:
parent
20443dad24
commit
55d7f20d80
3 changed files with 8 additions and 2 deletions
|
@ -368,6 +368,8 @@ static bool header_property(TRANS_PROPERTY *prop)
|
|||
TYPE_set_flag(&prop->type, TF_STATIC);
|
||||
TYPE_set_flag(&prop->type, TF_PUBLIC);
|
||||
|
||||
// property with variable
|
||||
|
||||
if (TRANS_is(RS_USE))
|
||||
{
|
||||
TRANS_DECL decl = ptype;
|
||||
|
@ -383,6 +385,10 @@ static bool header_property(TRANS_PROPERTY *prop)
|
|||
JOB->current++;
|
||||
|
||||
decl.index = prop->use;
|
||||
|
||||
if (TRANS_is(RS_EQUAL))
|
||||
decl.init = JOB->current;
|
||||
|
||||
CLASS_add_declaration(JOB->class, &decl);
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ void HELP_add_at_current_line(const char *help);
|
|||
void HELP_search_and_print(FILE *file, int line);
|
||||
void HELP_search_and_print_for_class(FILE *file);
|
||||
|
||||
#define HELP_is_help_comment(_ptr) ((_ptr)[0] == '\'' && ((_ptr)[1] == ' ' || ((_ptr)[1] == '\'' && (_ptr)[2] == ' ')))
|
||||
#define HELP_is_help_comment(_ptr) ((_ptr)[0] == '\'' && (isspace((_ptr)[1]) || ((_ptr)[1] == '\'' && isspace((_ptr)[2]))))
|
||||
#define HELP_is_for_class(_help) ((_help)[0] == '\'' && (_help)[1] == '\'')
|
||||
#define HELP_is_void_line(_help) ((_help)[0] == '\n' && (_help)[1] == 0)
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#undef isdigit
|
||||
#define isdigit(_c) (READ_digit_car[(uchar)(_c)])
|
||||
#undef isspace
|
||||
#define isspace(_c) (((uchar)_c) <= ' ')
|
||||
#define isspace(_c) (((uchar)(_c)) <= ' ')
|
||||
|
||||
#ifndef __GBC_READ_C
|
||||
extern char READ_digit_car[];
|
||||
|
|
Loading…
Reference in a new issue