[flang] Simplify CommonStmt in parse tree
authorTim Keith <tkeith@nvidia.com>
Wed, 13 Feb 2019 00:13:58 +0000 (16:13 -0800)
committerTim Keith <tkeith@nvidia.com>
Wed, 13 Feb 2019 00:13:58 +0000 (16:13 -0800)
commitb60fd092f52757a7b2cc6f22cdd75f3dba361163
treebfba6c4522b5d843220a021ab519f9ae52772c0a
parentc2c0438b6e71614cca855b965899fae6187d966f
[flang] Simplify CommonStmt in parse tree

The grammar requires parsing the first common block in a common stmt
differently from the others: the '//' is optional for the blank common.

But once it's parsed, it is easier to work with if each is represented
as a `parser::CommonStmt::Block`. This is achieved by using the same
constructor for `CommonStmt` but then including the first block in
the list of blocks.

Original-commit: flang-compiler/f18@dd46afd6b5607ec61ea9b2e97efa16deda31441b
Reviewed-on: https://github.com/flang-compiler/f18/pull/284
flang/lib/parser/parse-tree-visitor.h
flang/lib/parser/parse-tree.cc
flang/lib/parser/parse-tree.h
flang/lib/parser/unparse.cc