summaryrefslogtreecommitdiffstats
path: root/src/gram.y
diff options
context:
space:
mode:
authorAndrés <andmarti@gmail.com>2021-03-06 15:46:10 -0300
committerAndrés <andmarti@gmail.com>2021-03-06 15:46:10 -0300
commit95e5f079a69e20ed1116d44b57400c1ccb76529b (patch)
treed29749e7f9d1fe3502547e6442fdaeb41a302d4d /src/gram.y
parent51019fd9201271cff5a88348c24974667dea0d8f (diff)
work on issue #451
Diffstat (limited to 'src/gram.y')
-rwxr-xr-xsrc/gram.y11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gram.y b/src/gram.y
index c5f73b3..c8633af 100755
--- a/src/gram.y
+++ b/src/gram.y
@@ -321,6 +321,7 @@ token S_YANKCOL
%token K_VLOOKUP
%token K_INDEX
%token K_STINDEX
+%token K_GETENT
/*
token K_AUTO
token K_AUTOINSERT
@@ -798,6 +799,16 @@ term: var { $$ = new_var(O_VAR, $1); }
| '@' K_FIXED term { $$ = new('f', $3, ENULL); }
| '(' '@' K_FIXED ')' term
{ $$ = new('F', $5, ENULL); }
+ | '@' K_GETENT '(' NUMBER ',' NUMBER ')' {
+ struct ent_ptr ep;
+ ep.vp = lookat($4, $6);
+ ep.vf = 0;
+ $$ = new(GETENT, new_var(O_VAR, ep), ENULL);
+
+ // Work on issue #451.
+ // @sum(A0:@getent(@lastrow, 2))
+ // @sum(A0:@getent("A",@lastrow))
+ }
| '@' K_SUM '(' var_or_range ')'
{ $$ = new(SUM, new_range(REDUCE | SUM, $4), ENULL); }
| '@' K_SUM '(' range ',' e ')'