mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 03:28:19 +00:00
Introduce special treatment for the blank identifier _
Mostly: Do not instantiate variables within for loops and allow reusing differently typed blanks which previously wasn't possible. This may be missing some corner-cases, but the added tests seem to work as expected and nothing else fell apart it seems.
This commit is contained in:
parent
7f7c77ab07
commit
46334f8b59
21 changed files with 318 additions and 20 deletions
3
src/ID.h
3
src/ID.h
|
@ -105,6 +105,7 @@ public:
|
|||
|
||||
void SetOption();
|
||||
bool IsOption() const { return is_option; }
|
||||
bool IsBlank() const { return is_blank; };
|
||||
|
||||
void SetEnumConst() { is_enum_const = true; }
|
||||
bool IsEnumConst() const { return is_enum_const; }
|
||||
|
@ -162,7 +163,7 @@ protected:
|
|||
bool is_export;
|
||||
bool infer_return_type;
|
||||
TypePtr type;
|
||||
bool is_const, is_enum_const, is_type, is_option;
|
||||
bool is_const, is_enum_const, is_type, is_option, is_blank;
|
||||
int offset;
|
||||
ValPtr val;
|
||||
AttributesPtr attrs;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue