mirror of
https://github.com/github/semantic.git
synced 2024-12-25 16:02:43 +03:00
Compute the fields of the record.
This commit is contained in:
parent
acfcee116f
commit
3f7ac5eb50
@ -133,6 +133,9 @@ prog6 =
|
||||
|
||||
ruby :: File (Term Core User)
|
||||
ruby = fromBody $ annWith callStack (rec (named' __semantic_global) (binds
|
||||
bindings
|
||||
(Core.record (map (\ (Named _ v :<- _) -> (v, pure v)) bindings))))
|
||||
where bindings =
|
||||
[ named' "Class" :<- ann (Core.record
|
||||
[ ("new", lam (named' "self")
|
||||
( named' "instance" :<- Core.record [ (__semantic_super, pure "self") ]
|
||||
@ -184,28 +187,7 @@ ruby = fromBody $ annWith callStack (rec (named' __semantic_global) (binds
|
||||
|
||||
, named' "require" :<- lam (named' "path") (Core.load (pure "path"))
|
||||
]
|
||||
(Core.record (map ((,) <*> pure)
|
||||
[ "Class"
|
||||
, "(Object)"
|
||||
, "Object"
|
||||
, "(NilClass)"
|
||||
, "NilClass"
|
||||
, "(TrueClass)"
|
||||
, "TrueClass"
|
||||
, "(FalseClass)"
|
||||
, "FalseClass"
|
||||
, "nil"
|
||||
, "true"
|
||||
, "false"
|
||||
, "require"
|
||||
|
||||
, "nil"
|
||||
, "true"
|
||||
, "false"
|
||||
|
||||
, "require"
|
||||
]))))
|
||||
where self $$$ method = annWith callStack $ named' "_x" :<- self >>>= pure "_x" ... method $$ pure "_x"
|
||||
self $$$ method = annWith callStack $ named' "_x" :<- self >>>= pure "_x" ... method $$ pure "_x"
|
||||
record ... field = annWith callStack $ record Core.... field
|
||||
|
||||
__semantic_global = "__semantic_global"
|
||||
|
Loading…
Reference in New Issue
Block a user