aboutsummaryrefslogtreecommitdiffstats
path: root/system/doc/extensions/mexpand.erl
blob: 261f99da46a8293686875a153f4e1b02dc27bf2f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
-module(mexpand).

-export([file/1]).

-import(lists, [foreach/2]).

file(File) ->
    case epp:parse_file(File ++ ".erl", [],[]) of
	{ok, L} ->
	    {ok, Stream} = file:open(File ++ ".out", write),
	    foreach(fun(X) ->
			    io:format(Stream,"~s~n",
				      [erl_pp:form(X)])
		    end, L),
	    file:close(Stream)
    end.