1
1
mirror of https://github.com/github/semantic.git synced 2024-11-24 00:42:33 +03:00

Implement member lookup in a way that doesn't crash the scope graph

This commit is contained in:
Patrick Thomson 2019-10-23 14:30:45 -04:00
parent 9b46692cbd
commit 21dd102e61

View File

@ -1,11 +1,12 @@
{
type <- \name -> \bases -> \dict ->
#record { __name: name, __bases: bases, __dict: dict };
type <- \name -> \super -> \slots ->
#record { __name: name, __super: super, __slots: slots };
object <- type "object" #unit #record{};
#record { type: type, object: object }
getitem <- rec getitem = \item -> \attr ->
if item.slots.?attr then item.slots.attr else #unit;
#record { type: type, object: object, getitem: getitem }
lookup <- \item -> \name -> if item.?name then item.name else item.class.name
}