Skip to content

Commit

Permalink
Merge pull request #17 from danikp/master
Browse files Browse the repository at this point in the history
more Erlang 18 updates
  • Loading branch information
danikp committed Jan 6, 2016
2 parents ee1056f + 324e5fc commit e5af421
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ language: erlang
sudo: false
otp_release:
# Test on all supported releases
- 18.2.1
- 18.1
- 18.0
- 17.5
- 17.4
Expand Down
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
REBAR=./rebar
GIT = git
REBAR_VER = 2.6.1

## dialyzer
PLT_FILE = ~/aleppo.plt
Expand All @@ -14,6 +16,14 @@ compile:
run:
@$(REBAR) shell

rebar_src:
@rm -rf $(PWD)/rebar_src
@$(GIT) clone git://github.com/rebar/rebar.git rebar_src
@$(GIT) -C rebar_src checkout tags/$(REBAR_VER)
@cd $(PWD)/rebar_src/; ./bootstrap
@cp $(PWD)/rebar_src/rebar $(PWD)
@rm -rf $(PWD)/rebar_src

dialyze: all
@[ -f $(PLT_FILE) ] || $(MAKE) plt
@dialyzer --plt $(PLT_FILE) $(DIALYZER_OPTS) ebin || [ $$? -eq 2 ];
Expand Down
Binary file modified rebar
Binary file not shown.
10 changes: 9 additions & 1 deletion rebar.config
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
{erl_opts, [ {platform_define, "^R|17", pre18} ]}.
%-*-Erlang-*-
% vim: ft=erlang
{erl_opts, [
debug_info,
warn_unused_vars,
warn_unused_import,
warn_exported_vars,
{platform_define, "^R|17", pre18}
]}.
2 changes: 1 addition & 1 deletion src/aleppo.app.src
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
%% -*- mode: erlang -*-
{application, aleppo,
[{description, "Aleppo: ALternative Erlang Pre-ProcessOr"},
{vsn, "0.8.15"},
{vsn, "0.9"},
{modules, [
]},
{applications, [kernel, stdlib]},
Expand Down
2 changes: 1 addition & 1 deletion src/aleppo.erl
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ mark_keywords([{'-', DashAttrs} = Dash,
end,
mark_keywords(Rest, Mod, [MarkedToken, Dash|Acc]);
_ ->
mark_keywords(Rest, Mod, [Token |Acc])
mark_keywords(Rest, Mod, [Token, Dash|Acc])
end;
mark_keywords([Other|Rest], Mod, Acc) ->
mark_keywords(Rest, Mod, [Other|Acc]).
Expand Down
19 changes: 11 additions & 8 deletions src/aleppo_parser.yrl
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,25 @@ Terminals
'?'

char integer float atom string var
'(' ')' ',' '-'
'->' ':-' '{' '}' '[' ']' '|' '||' '<-' ';' ':' '#' '.' ':=' '=>'

'(' ')' ',' '->' '{' '}' '[' ']' '|' '||' '<-' ';' ':' '#' '.'
'after' 'begin' 'case' 'try' 'catch' 'end' 'fun' 'if' 'of' 'receive' 'when'
'andalso' 'orelse' 'query' 'spec'
'andalso' 'orelse'
'bnot' 'not'
'*' '/' 'div' 'rem' 'band' 'and'
'+' 'bor' 'bxor' 'bsl' 'bsr' 'or' 'xor'
'+' '-' 'bor' 'bxor' 'bsl' 'bsr' 'or' 'xor'
'++' '--'
'==' '/=' '=<' '<' '>=' '>' '=:=' '=/=' '<='
'==' '/=' '=<' '<' '>=' '>' '=:=' '=/=' '<=' '=>' ':='
'<<' '>>'
'!' '=' '::' '..' '...'
comment dot.
'spec' 'callback' % helper
comment
dot.

Rootsymbol File.

Unary 200 '('.

File -> Elements eof : '$1' ++ ['$2'].
File -> Elements : '$1' ++ [{eof, 0}].

Expand Down Expand Up @@ -145,7 +149,6 @@ ExpressionToken -> atom : '$1'.
ExpressionToken -> string : '$1'.
ExpressionToken -> var : '$1'.
ExpressionToken -> '->' : '$1'.
ExpressionToken -> ':-' : '$1'.
ExpressionToken -> '|' : '$1'.
ExpressionToken -> '||' : '$1'.
ExpressionToken -> '<-' : '$1'.
Expand All @@ -168,8 +171,8 @@ ExpressionToken -> 'receive' : '$1'.
ExpressionToken -> 'when' : '$1'.
ExpressionToken -> 'andalso' : '$1'.
ExpressionToken -> 'orelse' : '$1'.
ExpressionToken -> 'query' : '$1'.
ExpressionToken -> 'spec' : '$1'.
ExpressionToken -> 'callback' : '$1'.
ExpressionToken -> 'bnot' : '$1'.
ExpressionToken -> 'not' : '$1'.
ExpressionToken -> '*' : '$1'.
Expand Down

0 comments on commit e5af421

Please sign in to comment.