rebcabin / masr

Meta ASR: replacement for aging ASDL
MIT License
4 stars 0 forks source link

Explore "regex specs" for `node*`, `symbol*`, `expr?`, etc. #29

Open rebcabin opened 1 year ago

rebcabin commented 1 year ago

Reminder to me.

rebcabin commented 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.

rebcabin commented 1 year ago

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.