Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 36 lines (20 sloc) 1.222 kB
a36f0cb @evanmiller Initial commit
evanmiller authored
1 Aleppo: ALternative Erlang Pre-ProcessOr
2 ========================================
3
14238fe @evanmiller Update README
evanmiller authored
4 Aleppo is an alternative to `epp(3erl)`, and is mainly intended for Erlang compiler hackers. The problem with EPP is that it only operates on Erlang source files. Aleppo will operate directly on tokens returned by erl_scan.
a36f0cb @evanmiller Initial commit
evanmiller authored
5
6 erl_scan -> *aleppo* -> erl_parse -> compile
7
8 Features
9 --------
10
11 * Token-oriented API. Pass in tokens returned by erl_scan, receive a list of
12 erl_scan-compatible tokens after preprocessor macros have been applied.
13 No parsing of Erlang code is performed!
14
15 * Support for -define, -undef, -ifdef, -ifndef, -else, -endif, -include, -include_lib
16
17 * Preprocessor directives can be used inside functions
18
19
20 API
21 ---
22
23 aleppo:process_file(FileName) -> {ok, Tokens} | {error, Error}
24
25 aleppo:process_tokens(Tokens) -> {ok, NewTokens} | {error, Error}
26
27 aleppo:process_tokens(Tokens, Options) -> {ok, NewTokens} | {error, Error}
28
a33e7c1 @evanmiller update README
evanmiller authored
29 Options = [{file, FileName}, {include, [IncludeSearchDirectories]}]
14238fe @evanmiller Update README
evanmiller authored
30
31
32 Notes
33 -----
34
35 When calling erl_scan:tokens/3, be sure to pass in a `{Row, Column}` tuple as the third argument (not just a Row integer). Otherwise Aleppo will not properly handle `-include` directives.
Something went wrong with that request. Please try again.