codex-python / nodes /retriever /grammar.gf
tailot's picture
Upload folder using huggingface_hub
339ddd8 verified
Raw History Blame Contribute Delete
574 Bytes
-- Node retriever (to executor): gathers Python AST symbols, imports, and call edges.
-- NOTE: this specification has not been compiled with the GF toolchain in the authoring environment.
abstract PythonRetriever = {
cat
Context ; Symbol ; Edge ;
fun
Gather : Symbol -> Edge -> Context ;
Sym : String -> Symbol ;
Dep : String -> String -> Edge ;
}
concrete PythonRetrieverEng of PythonRetriever = {
lincat
Context, Symbol, Edge = Str ;
lin
Gather s e = "context" ++ s ++ "edges" ++ e ;
Sym n = n.s ;
Dep a b = a.s ++ "->" ++ b.s ;
}