Skip to content

Instantly share code, notes, and snippets.

@nox
Created August 16, 2012 10:01
Show Gist options
  • Save nox/3369036 to your computer and use it in GitHub Desktop.
Save nox/3369036 to your computer and use it in GitHub Desktop.
nox@Shinkirou:~/src/otp[erl_parse-range=]$ cat blah.erl
-module(blah).
blah() -> ?LINE.
nox@Shinkirou:~/src/otp[erl_parse-range=]$ bin/erl
Erlang R15B02 (erts-5.9.2) [source] [smp:8:8] [async-threads:0] [hipe] [kernel-poll:false]
Eshell V5.9.2 (abort with ^G)
1> epp:parse_file("blah.erl", {1,1}, [], [], [range]).
{ok,[{attribute,1,file,{"blah.erl",1}},
{attribute,[{column,2},
{line,1},
{'end',{2,1}},
{'begin',{1,1}}],
module,blah},
{function,[{column,1},
{line,2},
{'end',{3,1}},
{'begin',{2,1}}],
blah,0,
[{clause,[{column,1},
{line,2},
{'end',{2,16}},
{'begin',{2,1}}],
[],[],
[{integer,[{column,12},
{line,2},
{'end',{2,16}},
{'begin',{2,11}}],
2}]}]},
{eof,{3,1}}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment