Open rebcabin opened 1 year ago
The issue concerns singletons. Should an expr?
be a (42)
(a collection with one element) or a 42
(a bare element). This issue intersects the vexing nilable
hack to avoid keyed alternatives like [:id 42]
and [:empty ()]
. The nilable
hack was introduce to save some legacy-mode functions. In legacy mode, something like (type-declaration ())
really means (type-declaration nil)
, because a type declaration is either a single symtab-id
or nothing. Legacy-mode ASDL uses ()
as an alias for nothing
. We need to do better. It's a design issue to figure out what better
means.
MASR currently represents types like expr*
as collections with a maximum length, via s/coll-of
. It might be better to represent them with a regex spec. It's an experiment to try it.
Reminder to me.