diff options
author | Björn Gustavsson <[email protected]> | 2015-04-30 12:23:45 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2015-04-30 12:23:45 +0200 |
commit | a5c6199d194b47c4385083d5aca35807c50c1549 (patch) | |
tree | c7edf5193895d6252e3dbd61ee48746d0de2b942 /lib/syntax_tools/src | |
parent | 147e8b9bd0b36315f0d8bd38e39c51d93cd9f509 (diff) | |
parent | a1f9b09e47dfa56957c36b39d3d3e541c7cd9d19 (diff) | |
download | otp-a5c6199d194b47c4385083d5aca35807c50c1549.tar.gz otp-a5c6199d194b47c4385083d5aca35807c50c1549.tar.bz2 otp-a5c6199d194b47c4385083d5aca35807c50c1549.zip |
Merge branch 'hb/line_abstraction/OTP-12195'
* hb/line_abstraction/OTP-12195: (21 commits)
Ensure that erl_anno is used when building the primary bootstrap
erl_docgen: Use module erl_anno
wx: Use module erl_anno
diameter: Use module erl_anno
dialyzer: Use module erl_anno
eunit: Use module erl_anno
hipe: Use module erl_anno
edoc: Use module erl_anno
syntax_tools: Use module erl_anno
test_server: Use module erl_anno
tools: Use module erl_anno
parsetools: Use module erl_anno
kernel: Use module erl_anno
asn1: Use module erl_anno
debugger: Use module erl_anno
stdlib: Silence some of qlc's warnings
stdlib: Use module erl_anno
compiler: Use module erl_anno
emulator: Use module erl_anno
Update primary bootstrap
...
Diffstat (limited to 'lib/syntax_tools/src')
-rw-r--r-- | lib/syntax_tools/src/epp_dodger.erl | 2 | ||||
-rw-r--r-- | lib/syntax_tools/src/erl_recomment.erl | 9 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/syntax_tools/src/epp_dodger.erl b/lib/syntax_tools/src/epp_dodger.erl index 3ca7a8197e..39c522fd11 100644 --- a/lib/syntax_tools/src/epp_dodger.erl +++ b/lib/syntax_tools/src/epp_dodger.erl @@ -454,7 +454,7 @@ io_error(L, Desc) -> {L, ?MODULE, Desc}. start_pos([T | _Ts], _L) -> - element(2, T); + erl_anno:line(element(2, T)); start_pos([], L) -> L. diff --git a/lib/syntax_tools/src/erl_recomment.erl b/lib/syntax_tools/src/erl_recomment.erl index 7b2f9f7adb..72e1e2d2f5 100644 --- a/lib/syntax_tools/src/erl_recomment.erl +++ b/lib/syntax_tools/src/erl_recomment.erl @@ -123,7 +123,6 @@ recomment_forms(Tree, Cs, Insert) -> form_list -> Tree1 = erl_syntax:flatten_form_list(Tree), Node = build_tree(Tree1), - %% Here we make a small assumption about the substructure of %% a `form_list' tree: it has exactly one group of subtrees. [Node1] = node_subtrees(Node), @@ -753,7 +752,13 @@ get_line(Node) -> {_, L, _} when is_integer(L) -> L; Pos -> - exit({bad_position, Pos}) + try erl_anno:line(Pos) of + Line -> + Line + catch + _:_ -> + exit({bad_position, Pos}) + end end. |