mirror of
https://github.com/zeek/zeek.git
synced 2025-10-14 12:38:20 +00:00
Change substring index notation to use a colon (addresses #422).
String slice notation is written as `s[1:2]` instead of `s[1, 2]` because the later is ambiguous with composite index types.
This commit is contained in:
parent
e638f04301
commit
8b46bbb1c0
5 changed files with 46 additions and 24 deletions
|
@ -418,6 +418,14 @@ expr:
|
|||
$$ = new IndexExpr($1, $3);
|
||||
}
|
||||
|
||||
| expr '[' expr ':' expr ']'
|
||||
{
|
||||
set_location(@1, @6);
|
||||
ListExpr* le = new ListExpr($3);
|
||||
le->Append($5);
|
||||
$$ = new IndexExpr($1, le, true);
|
||||
}
|
||||
|
||||
| expr '$' TOK_ID
|
||||
{
|
||||
set_location(@1, @3);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue