Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang
parse_trans
parse_trans-3.4.1-git.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File parse_trans-3.4.1-git.patch of Package parse_trans
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ff63ca5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,24 @@ +name: CI + +on: + push: + pull_request: + branches: [ $default-branch ] + release: + types: + - created + +jobs: + test: + name: "Erlang Test" + runs-on: ubuntu-latest + strategy: + matrix: + otp: [21, 22, 23, 24, 25, 26] + fail-fast: false + container: + image: erlang:${{ matrix.otp }} + steps: + - uses: actions/checkout@v3 + - name: Test + run: make & make test diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 0f62886..0000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -language: erlang -otp_release: -- 23.1.2 -- 22.3.4 -- 21.3.8 -script: -- rebar3 eunit -notifications: - email: - on_success: never diff --git a/Makefile b/Makefile index 8146e68..3015aab 100644 --- a/Makefile +++ b/Makefile @@ -14,5 +14,5 @@ test: $(REBAR3) eunit doc: - $(REBAR3) doc + $(REBAR3) edoc diff --git a/README.md b/README.md index 286daea..1c0fefa 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ __Authors:__ Ulf Wiger ([`ulf@wiger.net`](mailto:ulf@wiger.net)). Parse_transform utilities -[![Build Status](https://travis-ci.org/uwiger/parse_trans.svg)](https://travis-ci.com/github/uwiger/parse_trans) +[![Build Status](https://github.com/uwiger/parse_trans/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/uwiger/parse_trans/actions/workflows/ci.yml) [![Hex pm](http://img.shields.io/hexpm/v/parse_trans.svg?style=flat)](https://hex.pm/packages/parse_trans) diff --git a/doc/README.md b/doc/README.md index a770aef..27696cf 100644 --- a/doc/README.md +++ b/doc/README.md @@ -6,7 +6,7 @@ __Authors:__ Ulf Wiger ([`ulf@wiger.net`](mailto:ulf@wiger.net)). Parse_transform utilities -[![Build Status](https://travis-ci.org/uwiger/parse_trans.svg) +[![Build Status](https://github.com/uwiger/parse_trans/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/uwiger/parse_trans/actions/workflows/ci.yml) [![Hex pm](http://img.shields.io/hexpm/v/parse_trans.svg?style=flat)](https://hex.pm/packages/parse_trans) diff --git a/doc/overview.edoc b/doc/overview.edoc index e8f7008..45bb37c 100644 --- a/doc/overview.edoc +++ b/doc/overview.edoc @@ -2,7 +2,7 @@ @doc Parse_transform utilities -[![Build Status](https://travis-ci.org/uwiger/parse_trans.svg) +[![Build Status](https://github.com/uwiger/parse_trans/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/uwiger/parse_trans/actions/workflows/ci.yml) [![Hex pm](http://img.shields.io/hexpm/v/parse_trans.svg?style=flat)](https://hex.pm/packages/parse_trans) <h2>Introduction</h2> @@ -22,4 +22,4 @@ Less known modules, perhaps: * {@link parse_trans} provides various helper functions for traversing code and managing complex parse transforms -@end \ No newline at end of file +@end diff --git a/doc/parse_trans.md b/doc/parse_trans.md index 136e0bc..f69e977 100644 --- a/doc/parse_trans.md +++ b/doc/parse_trans.md @@ -104,7 +104,7 @@ Returns the name of the file being compiled.</td></tr><tr><td valign="top"><a hr Returns the name of the module being compiled.</td></tr><tr><td valign="top"><a href="#get_orig_syntax_tree-1">get_orig_syntax_tree/1</a></td><td>.</td></tr><tr><td valign="top"><a href="#get_pos-1">get_pos/1</a></td><td> Tries to retrieve the line number from an erl_syntax form.</td></tr><tr><td valign="top"><a href="#initial_context-2">initial_context/2</a></td><td> Initializes a context record.</td></tr><tr><td valign="top"><a href="#inspect-4">inspect/4</a></td><td> -Equvalent to do_inspect(Fun,Acc,Forms,initial_context(Forms,Options)).</td></tr><tr><td valign="top"><a href="#optionally_pretty_print-3">optionally_pretty_print/3</a></td><td></td></tr><tr><td valign="top"><a href="#plain_transform-2">plain_transform/2</a></td><td> +Equivalent to do_inspect(Fun,Acc,Forms,initial_context(Forms,Options)).</td></tr><tr><td valign="top"><a href="#optionally_pretty_print-3">optionally_pretty_print/3</a></td><td></td></tr><tr><td valign="top"><a href="#plain_transform-2">plain_transform/2</a></td><td> Performs a transform of <code>Forms</code> using the fun <code>Fun(Form)</code>.</td></tr><tr><td valign="top"><a href="#pp_beam-1">pp_beam/1</a></td><td> Reads debug_info from the beam file Beam and returns a string containing the pretty-printed corresponding erlang source code.</td></tr><tr><td valign="top"><a href="#pp_beam-2">pp_beam/2</a></td><td> @@ -122,10 +122,9 @@ Makes one pass.</td></tr></table> ### context/2 ### <pre><code> -context(X1::Attr, Context) -> any() +context(X1::atom(), Context::#context{}) -> term() </code></pre> - -<ul class="definitions"><li><code>Attr = module | function | arity | options</code></li></ul> +<br /> Accessor function for the Context record. @@ -179,10 +178,9 @@ do_transform(F::<a href="#type-xform_f_rec">xform_f_rec()</a>, Acc::term(), Form ### error/3 ### <pre><code> -error(R::Reason, F::Form, I::Info) -> <a href="#type-throw">throw()</a> +error(R::string(), F::any(), I::[{any(), any()}]) -> none() </code></pre> - -<ul class="definitions"><li><code>Info = [{Key, Value}]</code></li></ul> +<br /> Used to report errors detected during the parse transform. @@ -237,7 +235,7 @@ Note that a stacktrace is generated inside this function. ### function_exists/3 ### <pre><code> -function_exists(Fname::atom(), Arity::integer(), Forms) -> boolean() +function_exists(Fname::atom(), Arity::integer(), Forms::<a href="#type-forms">forms()</a>) -> boolean() </code></pre> <br /> @@ -248,10 +246,9 @@ Checks whether the given function is defined in Forms. ### get_attribute/2 ### <pre><code> -get_attribute(A, Forms) -> any() +get_attribute(A::atom(), Forms::[any()]) -> none | [<a href="/home/uwiger/uw/syntax_tools/doc/erl_syntax.md#type-syntaxTree">erl_syntax:syntaxTree()</a>] </code></pre> - -<ul class="definitions"><li><code>A = atom()</code></li></ul> +<br /> Returns the value of the first occurrence of attribute A. @@ -266,7 +263,7 @@ Returns the value of the first occurrence of attribute A. ### get_file/1 ### <pre><code> -get_file(Forms) -> string() +get_file(Forms::<a href="#type-forms">forms()</a>) -> string() </code></pre> <br /> @@ -277,7 +274,7 @@ Returns the name of the file being compiled. ### get_module/1 ### <pre><code> -get_module(Forms) -> atom() +get_module(Forms::[any()]) -> atom() </code></pre> <br /> @@ -288,7 +285,7 @@ Returns the name of the module being compiled. ### get_orig_syntax_tree/1 ### <pre><code> -get_orig_syntax_tree(File) -> Forms +get_orig_syntax_tree(File::string()) -> <a href="#type-forms">forms()</a> </code></pre> <br /> @@ -302,7 +299,7 @@ uses epp_dodger). ### get_pos/1 ### <pre><code> -get_pos(I::list()) -> integer() +get_pos(I::list()) -> <a href="/home/uwiger/uw/stdlib/doc/erl_anno.md#type-location">erl_anno:location()</a> </code></pre> <br /> @@ -314,7 +311,7 @@ Tries to retrieve the line number from an erl_syntax form. Returns a ### initial_context/2 ### <pre><code> -initial_context(Forms, Options) -> #context{} +initial_context(Forms::<a href="#type-forms">forms()</a>, Options::<a href="#type-options">options()</a>) -> #context{} </code></pre> <br /> @@ -328,12 +325,11 @@ name and the options passed to the transform function. ### inspect/4 ### <pre><code> -inspect(F::Fun, Acc::Forms, Forms::Acc, Options) -> NewAcc +inspect(F::<a href="#type-insp_f">insp_f()</a>, A, Forms::<a href="#type-forms">forms()</a>, Options::<a href="#type-options">options()</a>) -> A </code></pre> +<br /> -<ul class="definitions"><li><code>Fun = function()</code></li></ul> - -Equvalent to do_inspect(Fun,Acc,Forms,initial_context(Forms,Options)). +Equivalent to do_inspect(Fun,Acc,Forms,initial_context(Forms,Options)). <a name="optionally_pretty_print-3"></a> @@ -389,7 +385,7 @@ Example - This transform fun would convert all instances of `P ! Msg` to ### pp_beam/1 ### <pre><code> -pp_beam(Beam::<a href="file.md#type-filename">file:filename()</a>) -> string() | {error, Reason} +pp_beam(Beam::<a href="/home/uwiger/uw/kernel/doc/file.md#type-filename">file:filename()</a>) -> ok </code></pre> <br /> @@ -401,7 +397,7 @@ the pretty-printed corresponding erlang source code. ### pp_beam/2 ### <pre><code> -pp_beam(Beam::<a href="#type-filename">filename()</a>, Out::<a href="#type-filename">filename()</a>) -> ok | {error, Reason} +pp_beam(F::<a href="/home/uwiger/uw/kernel/doc/file.md#type-filename">file:filename()</a>, Out::<a href="/home/uwiger/uw/kernel/doc/file.md#type-filename">file:filename()</a>) -> ok </code></pre> <br /> @@ -413,7 +409,7 @@ Erlang source code, storing it in the file Out. ### pp_src/2 ### <pre><code> -pp_src(Res::Forms, Out::<a href="#type-filename">filename()</a>) -> ok +pp_src(Res::<a href="#type-forms">forms()</a>, F::string()) -> ok </code></pre> <br /> @@ -470,7 +466,7 @@ using the function [`format_exception/2`](#format_exception-2). ### revert/1 ### <pre><code> -revert(Tree) -> Forms +revert(Tree::<a href="#type-forms">forms()</a>) -> <a href="#type-forms">forms()</a> </code></pre> <br /> @@ -527,10 +523,9 @@ top(F::function(), Forms::<a href="#type-forms">forms()</a>, Options::list()) -& ### transform/4 ### <pre><code> -transform(Fun, Acc, Forms, Options) -> {TransformedForms, NewAcc} +transform(Fun::<a href="#type-xform_f_rec">xform_f_rec()</a>, Acc, Forms::<a href="#type-forms">forms()</a>, Options::<a href="#type-options">options()</a>) -> {<a href="#type-forms">forms()</a>, Acc} | {error, list()} </code></pre> - -<ul class="definitions"><li><code>Fun = function()</code></li><li><code>Options = [{Key, Value}]</code></li></ul> +<br /> Makes one pass diff --git a/doc/parse_trans_pp.md b/doc/parse_trans_pp.md index 8e268b9..1fdbb27 100644 --- a/doc/parse_trans_pp.md +++ b/doc/parse_trans_pp.md @@ -57,7 +57,7 @@ main(X1::[string()]) -> any() ### pp_beam/1 ### <pre><code> -pp_beam(Beam::<a href="#type-filename">filename()</a>) -> string() | {error, Reason} +pp_beam(Beam::<a href="/home/uwiger/uw/kernel/doc/file.md#type-filename">file:filename()</a>) -> ok | {error, any()} </code></pre> <br /> @@ -69,7 +69,7 @@ the pretty-printed corresponding erlang source code. ### pp_beam/2 ### <pre><code> -pp_beam(Beam::<a href="#type-filename">filename()</a>, Out::<a href="#type-filename">filename()</a>) -> ok | {error, Reason} +pp_beam(F::<a href="/home/uwiger/uw/kernel/doc/file.md#type-filename">file:filename()</a>, Out::<a href="/home/uwiger/uw/kernel/doc/file.md#type-filename">file:filename()</a>) -> ok | {error, any()} </code></pre> <br /> @@ -81,7 +81,7 @@ Erlang source code, storing it in the file Out. ### pp_src/2 ### <pre><code> -pp_src(Forms0::Forms, Out::<a href="#type-filename">filename()</a>) -> ok +pp_src(Forms0::<a href="/home/uwiger/uw/parse_trans/doc/parse_trans.md#type-forms">parse_trans:forms()</a>, F::<a href="/home/uwiger/uw/kernel/doc/file.md#type-filename">file:filename()</a>) -> ok </code></pre> <br /> diff --git a/include/codegen.hrl b/include/codegen.hrl index a1dfd49..7a0f996 100644 --- a/include/codegen.hrl +++ b/include/codegen.hrl @@ -1,20 +1,19 @@ -%%% The contents of this file are subject to the Erlang Public License, -%%% Version 1.1, (the "License"); you may not use this file except in -%%% compliance with the License. You may obtain a copy of the License at -%%% http://www.erlang.org/EPLICENSE +%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- +%% -------------------------------------------------- +%% This file is provided to you under the Apache License, +%% Version 2.0 (the "License"); you may not use this file +%% except in compliance with the License. You may obtain +%% a copy of the License at %% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% The Original Code is parse_trans-2.0. -%% -%% Copyright (c) 2014 Ericsson AB +%% http://www.apache.org/licenses/LICENSE-2.0 %% -%% Contributor(s): ______________________________________. - -%%------------------------------------------------------------------- +%% Unless required by applicable law or agreed to in writing, +%% software distributed under the License is distributed on an +%% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +%% KIND, either express or implied. See the License for the +%% specific language governing permissions and limitations +%% under the License. +%% -------------------------------------------------- %% File : codegen.hrl %% @author : Ulf Wiger <ulf@wiger.net> %% @end diff --git a/include/exprecs.hrl b/include/exprecs.hrl index 6d92609..22cc4e6 100644 --- a/include/exprecs.hrl +++ b/include/exprecs.hrl @@ -1,20 +1,19 @@ -%%% The contents of this file are subject to the Erlang Public License, -%%% Version 1.1, (the "License"); you may not use this file except in -%%% compliance with the License. You may obtain a copy of the License at -%%% http://www.erlang.org/EPLICENSE +%% -*- erlang-indent-level: 4;indent-tabs-mode: nil -*- +%% -------------------------------------------------- +%% This file is provided to you under the Apache License, +%% Version 2.0 (the "License"); you may not use this file +%% except in compliance with the License. You may obtain +%% a copy of the License at %% -%% Software distributed under the License is distributed on an "AS IS" -%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See -%% the License for the specific language governing rights and limitations -%% under the License. -%% -%% The Original Code is exprecs-0.2. -%% -%% Copyright (c) 2014 Ericsson AB +%% http://www.apache.org/licenses/LICENSE-2.0 %% -%% Contributor(s): ______________________________________. - -%%------------------------------------------------------------------- +%% Unless required by applicable law or agreed to in writing, +%% software distributed under the License is distributed on an +%% "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +%% KIND, either express or implied. See the License for the +%% specific language governing permissions and limitations +%% under the License. +%% -------------------------------------------------- %% File : exprecs.hrl %% @author : Ulf Wiger <ulf@wiger.net> %% @end diff --git a/rebar.config b/rebar.config index f8f42cf..25c1026 100644 --- a/rebar.config +++ b/rebar.config @@ -25,11 +25,20 @@ ]}. {xref_checks, [undefined_function_calls]}. +{ex_doc, [ + {extras, ["README.md", "LICENSE"]}, + {main, "README.md"}, + {source_url, "https://github.com/uwiger/parse_trans"} +]}. + +{hex, [{doc, ex_doc}]}. + {profiles, - [{docs, + [{doc, [ - {deps, [{edown, "0.8.1"}]}, + {deps, [{edown, "0.9.1"}]}, {edoc_opts, [{doclet, edown_doclet}, + {branch, "master"}, {top_level_readme, {"./README.md", "http://github.com/uwiger/parse_trans", diff --git a/src/parse_trans.erl b/src/parse_trans.erl index c13385c..dc2b5b6 100644 --- a/src/parse_trans.erl +++ b/src/parse_trans.erl @@ -184,7 +184,7 @@ plain_transform1(Fun, [F|Fs]) when is_atom(element(1,F)) -> {done, NewF} -> [NewF | Fs]; {error, Reason} -> - error(Reason, F, [{form, F}]); + erlang:error(Reason, F, [{form, F}]); NewF when is_tuple(NewF) -> [NewF | plain_transform1(Fun, Fs)] end; @@ -509,7 +509,7 @@ option_value(Key, Options, Result) -> %%% @spec (Fun, Forms, Acc, Options) -> NewAcc %%% Fun = function() %%% @doc -%%% Equvalent to do_inspect(Fun,Acc,Forms,initial_context(Forms,Options)). +%%% Equivalent to do_inspect(Fun,Acc,Forms,initial_context(Forms,Options)). %%% @end %%% -spec inspect(insp_f(), A, forms(), options()) -> @@ -578,7 +578,7 @@ get_orig_syntax_tree(File) -> {ok, Forms} -> Forms; Err -> - error(error_reading_file, ?HERE, [{File,Err}]) + erlang:error(error_reading_file, ?HERE, [{File,Err}]) end. %%% @spec (Tree) -> Forms
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor