1%% Copyright (c) 2013-2016 Robert Virding
2%%
3%% Licensed under the Apache License, Version 2.0 (the "License");
4%% you may not use this file except in compliance with the License.
5%% You may obtain a copy of the License at
6%%
7%%     http://www.apache.org/licenses/LICENSE-2.0
8%%
9%% Unless required by applicable law or agreed to in writing, software
10%% distributed under the License is distributed on an "AS IS" BASIS,
11%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12%% See the License for the specific language governing permissions and
13%% limitations under the License.
14
15%% File    : lfe_macro.erl
16%% Author  : Robert Virding
17%% Purpose : Lisp Flavoured Erlang macro expander.
18
19%% We do a lot of quoting!
20-define(Q(E), [quote,E]).
21-define(BQ(E), [backquote,E]).
22-define(C(E), [comma,E]).
23-define(C_A(E), ['comma-at',E]).
24
25%% Macro expander state.
26-record(mac, {deep=true,                        %Deep expand everything
27              keep=true,                        %Keep all forms
28              module='-no-module-',             %Current module
29              line=1,                           %Line no of current form
30              vc=0,                             %Variable counter
31              fc=0,                             %Function counter
32              file=[],                          %File name
33              opts=[],                          %Compiler options
34              ipath=[],                         %Include path
35              errors=[],                        %Errors
36              warnings=[],                      %Warnings
37              unloadable=[]                     %Macro modules we can't load
38             }).
39