diff options
Diffstat (limited to 'gdb/f-exp.y')
-rw-r--r-- | gdb/f-exp.y | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/gdb/f-exp.y b/gdb/f-exp.y index e2c54b6..71f1823 100644 --- a/gdb/f-exp.y +++ b/gdb/f-exp.y @@ -280,7 +280,36 @@ subrange: ':' exp %prec ABOVE_COMMA subrange: ':' %prec ABOVE_COMMA { write_exp_elt_opcode (pstate, OP_RANGE); - write_exp_elt_longcst (pstate, 0); + write_exp_elt_longcst (pstate, SUBARRAY_NONE_BOUND); + write_exp_elt_opcode (pstate, OP_RANGE); } + ; + +/* Each subrange type can have a stride argument. */ +subrange: exp ':' exp ':' exp %prec ABOVE_COMMA + { write_exp_elt_opcode (pstate, OP_RANGE); + write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND + | SUBARRAY_HIGH_BOUND + | SUBARRAY_STRIDE); + write_exp_elt_opcode (pstate, OP_RANGE); } + ; + +subrange: exp ':' ':' exp %prec ABOVE_COMMA + { write_exp_elt_opcode (pstate, OP_RANGE); + write_exp_elt_longcst (pstate, SUBARRAY_LOW_BOUND + | SUBARRAY_STRIDE); + write_exp_elt_opcode (pstate, OP_RANGE); } + ; + +subrange: ':' exp ':' exp %prec ABOVE_COMMA + { write_exp_elt_opcode (pstate, OP_RANGE); + write_exp_elt_longcst (pstate, SUBARRAY_HIGH_BOUND + | SUBARRAY_STRIDE); + write_exp_elt_opcode (pstate, OP_RANGE); } + ; + +subrange: ':' ':' exp %prec ABOVE_COMMA + { write_exp_elt_opcode (pstate, OP_RANGE); + write_exp_elt_longcst (pstate, SUBARRAY_STRIDE); write_exp_elt_opcode (pstate, OP_RANGE); } ; |