Skip to content

Commit

Permalink
Polish the ASR part of the notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
certik committed May 9, 2019
1 parent 3db3031 commit afb4df0
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions doc/nb/Developer Tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,15 @@
"outputs": [],
"source": [
"from lfortran.semantic.ast_to_asr import ast_to_asr\n",
"from lfortran.asr.pprint import pprint_asr\n",
"asr = ast_to_asr(ast)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For example to print the variables defined in the function scope:"
"We can pretty print using the `pprint_asr()` function:"
]
},
{
Expand All @@ -115,7 +116,23 @@
"metadata": {},
"outputs": [],
"source": [
"print(asr.global_scope.symbols[\"f\"].symtab.symbols.keys())"
"pprint_asr(asr)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"For example to get the variables defined in the function scope:"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"asr.global_scope.symbols[\"f\"].symtab.symbols.keys()"
]
},
{
Expand Down

0 comments on commit afb4df0

Please sign in to comment.