Commit Graph
5 Commits
Author SHA1 Message Date
Richard SmithandJon Ross-Perkins 0c33dead70 Remove the type field from semantics nodes that don't produce values of that type. (#3049)
For `Assign` and `ReturnExpression`, this field wasn't used for
anything. For `StructTypeField`, we stored the type of the field here,
and now store it as an argument of the node instead.

---------

Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
2023-08-02 17:30:27 +00:00
Jon Ross-Perkins 43065a1257 Finish refactoring Push/Pop for stronger type handling. (#2987)
This adds a distinction between Unused and SoloParseNode, rather than
equating the two. This is intended to help identify nodes which are
getting pushed but maybe don't need to be.

Not totally done because I want to adjust declaration name handling due
to a quirk with how it mixes Name with Expression, but almost done. Once
that's done the type punning will be completely gone.
2023-07-14 23:16:16 +00:00
Jon Ross-Perkins 9751b4701d Start node stack push/pop setting IdT based on ParseNodeKind. (#2985)
I think there's more we can do here, but this seemed like a good
checkpoint to make sure the path I'm going down is roughly what you
expected. There's one actual edit in if expression structure to match
the increased enforcement.
2023-07-12 23:26:53 +00:00
Richard Smith f992d4d960 Don't return SemanticsFunction by value. (#2968)
It contains a vector, so it's not cheap to copy. Return by const
reference instead.

Thanks to @fasiddique for spotting this!
2023-07-05 22:09:50 +00:00
Richard Smith 288ad9f8e5 Split statement-specific parts of semantics_handle.cpp into separate files. (#2949)
`semantics_handle.cpp` is a little on the large side, and is going to grow as we add new nodes. Some of the statement-specific parts have already been split into their own files. Split out the remaining such parts.
2023-06-27 09:26:59 -07:00