mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 10:08:20 +00:00
Misc. tweaks to vector slicing implementation
* Minor style/format changes * Fix a signed/unsigned comparison compiler warning * Use a non-fatal error for non-integral slice indices so we can report any further scripting errors instead of stopping the parse right there
This commit is contained in:
parent
502ad9abc3
commit
91835752b7
5 changed files with 18 additions and 10 deletions
|
@ -484,8 +484,10 @@ expr:
|
|||
set_location(@1, @6);
|
||||
Expr* low = $3 ? $3 : new ConstExpr(val_mgr->GetCount(0));
|
||||
Expr* high = $5 ? $5 : new SizeExpr($1);
|
||||
|
||||
if ( ! IsIntegral(low->Type()->Tag()) || ! IsIntegral(high->Type()->Tag()) )
|
||||
reporter->FatalError("slice notation must have integral values as indexes");
|
||||
reporter->Error("slice notation must have integral values as indexes");
|
||||
|
||||
ListExpr* le = new ListExpr(low);
|
||||
le->Append(high);
|
||||
$$ = new IndexExpr($1, le, true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue