patrickfrey / mewa

Compiler-compiler for writing compiler frontends with Lua
https://github.com/patrickfrey/mewa
MIT License
23 stars 2 forks source link

Inconsistency in typedb interface: get_type, get_types #4

Closed patrickfrey closed 2 years ago

patrickfrey commented 2 years ago

The functions

typedb:get_type typedb:get_types

are inconsistent with the rest of the interface, where the other typedb:get_* functions always find something in the current or an enclosing scope. get_type and get_types return a type of a type list in the current scope only. They should be called this_type and this_types instead. get_type and get_types on the other hand should return a type of a list of types in the current or an enclosing scope to make the interface consistent.

patrickfrey commented 2 years ago

Renamed the functions get_type -> this_type get_types -> this_types and deprecated get_type and get_types

Currently, the use of get_type and get_types is redirected to this_type and this_types with a warning issued on stderr. Later, the use of get_type or get_types will raise an error.