Skip to content

Instantly share code, notes, and snippets.

@ezntek
Created July 26, 2023 02:41
Show Gist options
  • Select an option

  • Save ezntek/eadaaf6ae8632037e91ce16f6bde6254 to your computer and use it in GitHub Desktop.

Select an option

Save ezntek/eadaaf6ae8632037e91ce16f6bde6254 to your computer and use it in GitHub Desktop.
this is what happens
type = "Module"
name = "fib_generator"
[[content]]
type = "DefStmt"
kw_args = [ ]
[content.name]
type = "Ident"
name = "fibs"
[[content.args]]
type = "Ident"
name = "n"
[content.content]
type = "Block"
[[content.content.content]]
type = "DefStmt"
kw_args = [ ]
[content.content.content.name]
type = "Ident"
name = "fib"
[[content.content.content.args]]
type = "Ident"
name = "n"
[content.content.content.content]
type = "Block"
[[content.content.content.content.content]]
type = "IfStmt"
[[content.content.content.content.content.branches]]
type = "If"
[content.content.content.content.content.branches.condition]
type = "CmpExpr"
op = "Leq"
[[content.content.content.content.content.branches.condition.values]]
type = "Ident"
name = "n"
[[content.content.content.content.content.branches.condition.values]]
type = "Literal"
value = "1"
[content.content.content.content.content.branches.content]
type = "Block"
[[content.content.content.content.content.branches.content.content]]
type = "ReturnStmt"
[content.content.content.content.content.branches.content.content.value]
type = "Ident"
name = "n"
[[content.content.content.content.content]]
type = "ReturnStmt"
[content.content.content.content.content.value]
type = "MathExpr"
op = "Add"
[[content.content.content.content.content.value.values]]
type = "CallStmt"
kw_args = [ ]
[content.content.content.content.content.value.values.base]
type = "Ident"
name = "fib"
[[content.content.content.content.content.value.values.args]]
type = "MathExpr"
op = "Sub"
[[content.content.content.content.content.value.values.args.values]]
type = "Ident"
name = "n"
[[content.content.content.content.content.value.values.args.values]]
type = "Literal"
value = "1"
[[content.content.content.content.content.value.values]]
type = "CallStmt"
kw_args = [ ]
[content.content.content.content.content.value.values.base]
type = "Ident"
name = "fib"
[[content.content.content.content.content.value.values.args]]
type = "MathExpr"
op = "Sub"
[[content.content.content.content.content.value.values.args.values]]
type = "Ident"
name = "n"
[[content.content.content.content.content.value.values.args.values]]
type = "Literal"
value = "2"
[[content.content.content]]
type = "ForStmt"
[[content.content.content.iter_vals]]
type = "Ident"
name = "i"
[content.content.content.iter_subj]
type = "CallStmt"
kw_args = [ ]
[content.content.content.iter_subj.base]
type = "Ident"
name = "range"
[[content.content.content.iter_subj.args]]
type = "Ident"
name = "n"
[content.content.content.content]
type = "Block"
[[content.content.content.content.content]]
type = "YieldStmt"
[content.content.content.content.content.value]
type = "CallStmt"
kw_args = [ ]
[content.content.content.content.content.value.base]
type = "Ident"
name = "fib"
[[content.content.content.content.content.value.args]]
type = "MathExpr"
op = "Add"
[[content.content.content.content.content.value.args.values]]
type = "Ident"
name = "i"
[[content.content.content.content.content.value.args.values]]
type = "Literal"
value = "1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment