Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:25
erlang
2513-stdlib-Add-support-for-SSA-check-clauses-i...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2513-stdlib-Add-support-for-SSA-check-clauses-in-epp.patch of Package erlang
From 2c78dbc90e799b71473a2c8de43fbcb1daff405b Mon Sep 17 00:00:00 2001 From: Frej Drejhammar <frej.drejhammar@gmail.com> Date: Wed, 9 Nov 2022 12:27:11 +0100 Subject: [PATCH 03/13] stdlib: Add support for SSA check clauses in epp When epp:open/3 and parse_file/3 are given the option `{parse_checks, true}`, epp will parse and return ssa check clauses. --- lib/stdlib/doc/src/epp.xml | 10 +++++++++- lib/stdlib/src/epp.erl | 14 +++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/stdlib/doc/src/epp.xml b/lib/stdlib/doc/src/epp.xml index 11130b0065..45c0f241d2 100644 --- a/lib/stdlib/doc/src/epp.xml +++ b/lib/stdlib/doc/src/epp.xml @@ -4,7 +4,7 @@ <erlref> <header> <copyright> - <year>1996</year><year>2022</year> + <year>1996</year><year>2023</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -142,6 +142,10 @@ <p>The option <c>location</c> is forwarded to the Erlang token scanner, see <seemfa marker="erl_scan#tokens/3"><c>erl_scan:tokens/3,4</c></seemfa>.</p> + <p>The <c>{compiler_internal,term()}</c> option is forwarded + to the Erlang token scanner, see + <seeerl marker="erl_scan#compiler_interal"> + <c>{compiler_internal,term()}</c></seeerl>.</p> </desc> </func> @@ -193,6 +197,10 @@ <p>The option <c>location</c> is forwarded to the Erlang token scanner, see <seemfa marker="erl_scan#tokens/3"><c>erl_scan:tokens/3,4</c></seemfa>.</p> + <p>The <c>{compiler_internal,term()}</c> option is forwarded + to the Erlang token scanner, see + <seeerl marker="erl_scan#compiler_interal"> + <c>{compiler_internal,term()}</c></seeerl>.</p> </desc> </func> diff --git a/lib/stdlib/src/epp.erl b/lib/stdlib/src/epp.erl index bdb0bc64a2..5a14d12b3c 100644 --- a/lib/stdlib/src/epp.erl +++ b/lib/stdlib/src/epp.erl @@ -125,7 +125,8 @@ open(Name, Path, Pdm) -> {'name',FileName :: file:name()} | {'location',StartLocation :: erl_anno:location()} | {'fd',FileDescriptor :: file:io_device()} | - 'extra'], + 'extra' | + {'compiler_internal', [term()]}], Epp :: epp_handle(), Extra :: [{'encoding', source_encoding() | 'none'}], ErrorDescriptor :: term(). @@ -309,7 +310,8 @@ parse_file(Ifile, Path, Predefs) -> {'location',StartLocation :: erl_anno:location()} | {'reserved_word_fun', Fun :: fun((atom()) -> boolean())} | {'features', [Feature :: atom()]} | - 'extra'], + 'extra' | + {'compiler_internal', [term()]}], Form :: erl_parse:abstract_form() | {'error', ErrorInfo} | {'eof',Location}, @@ -608,6 +610,8 @@ init_server(Pid, FileName, Options, St0) -> SourceName = proplists:get_value(source_name, Options, FileName), Pdm = proplists:get_value(macros, Options, []), Features = proplists:get_value(features, Options, []), + Internal = proplists:get_value(compiler_internal, Options, []), + ParseChecks = proplists:get_bool(ssa_checks, Internal), Ms0 = predef_macros(SourceName, Features), case user_predef(Pdm, Ms0) of {ok,Ms1} -> @@ -631,7 +635,11 @@ init_server(Pid, FileName, Options, St0) -> default_encoding=DefEncoding, erl_scan_opts = [{text_fun, keep_ftr_keywords()}, - {reserved_word_fun, ResWordFun}], + {reserved_word_fun, ResWordFun}] + ++ if ParseChecks -> + [{compiler_internal,[ssa_checks]}]; + true -> [] + end, features = Features, else_reserved = ResWordFun('else'), deterministic = Deterministic}, -- 2.35.3
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