Skip to content

Commit

Permalink
chore: correct offset expressions in date-time expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
Ronald Holshausen authored and uglyog committed Aug 2, 2022
1 parent a36ce77 commit 8a6095c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ expression returns [ DateBase dateBase = DateBase.NOW, List<Adjustment<DateOffse
| op duration { if ($duration.d != null) $adj.add($duration.d.withOperation($op.o)); } ( op duration { if ($duration.d != null) $adj.add($duration.d.withOperation($op.o)); } )*
| base { $dateBase = $base.t; } ( op duration { if ($duration.d != null) $adj.add($duration.d.withOperation($op.o)); } )*
| 'next' offset { $adj.add(new Adjustment($offset.type, $offset.val, Operation.PLUS)); }
| 'next' offset { $adj.add(new Adjustment($offset.type, $offset.val, Operation.PLUS)); } op duration {
| 'next' offset { $adj.add(new Adjustment($offset.type, $offset.val, Operation.PLUS)); } ( op duration {
if ($duration.d != null) $adj.add($duration.d.withOperation($op.o));
}
} )*
| 'last' offset { $adj.add(new Adjustment($offset.type, $offset.val, Operation.MINUS)); }
| 'last' offset { $adj.add(new Adjustment($offset.type, $offset.val, Operation.MINUS)); } (op duration {
| 'last' offset { $adj.add(new Adjustment($offset.type, $offset.val, Operation.MINUS)); } ( op duration {
if ($duration.d != null) $adj.add($duration.d.withOperation($op.o));
})*
} )*
) EOF
;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ expression returns [ TimeBase timeBase = TimeBase.Now.INSTANCE, List<Adjustment<
| op duration { if ($duration.d != null) $adj.add($duration.d.withOperation($op.o)); } ( op duration { if ($duration.d != null) $adj.add($duration.d.withOperation($op.o)); } )*
| base { $timeBase = $base.t; } ( op duration { if ($duration.d != null) $adj.add($duration.d.withOperation($op.o)); } )*
| 'next' offset { $adj.add(new Adjustment($offset.type, $offset.val, Operation.PLUS)); }
| 'next' offset { $adj.add(new Adjustment($offset.type, $offset.val, Operation.PLUS)); } op duration {
| 'next' offset { $adj.add(new Adjustment($offset.type, $offset.val, Operation.PLUS)); } ( op duration {
if ($duration.d != null) $adj.add($duration.d.withOperation($op.o));
}
} )*
| 'last' offset { $adj.add(new Adjustment($offset.type, $offset.val, Operation.MINUS)); }
| 'last' offset { $adj.add(new Adjustment($offset.type, $offset.val, Operation.MINUS)); } (op duration {
| 'last' offset { $adj.add(new Adjustment($offset.type, $offset.val, Operation.MINUS)); } ( op duration {
if ($duration.d != null) $adj.add($duration.d.withOperation($op.o));
})*
} )*
) EOF
;

Expand Down

0 comments on commit 8a6095c

Please sign in to comment.