Skip to content

Commit 8de6f91

Browse files
authored
Merge pull request #175 from pragdave/spdx
added SPDX information
2 parents ce36b76 + 37adc95 commit 8de6f91

File tree

125 files changed

+290
-24
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+290
-24
lines changed

LICENSE

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@ Copyright © 2014 Dave Thomas, The Pragmatic Programmers
44
you may not use this file except in compliance with the License.
55
You may obtain a copy of the License at
66

7-
http://www.apache.org/licenses/LICENSE-2.0
7+
https://spdx.org/licenses/Apache-2.0.html
88

99
Unless required by applicable law or agreed to in writing, software
1010
distributed under the License is distributed on an "AS IS" BASIS,
1111
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
See the License for the specific language governing permissions and
1313
limitations under the License.
14+
15+
Note:
16+
Individual files contain the following tag instead of the full license text.
17+
18+
SPDX-License-Identifier: Apache-2.0

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -402,3 +402,5 @@ Copyright © 2014 Dave Thomas, The Pragmatic Programmers
402402
# LICENSE
403403

404404
Same as Elixir, which is Apache License v2.0. Please refer to [LICENSE](LICENSE) for details.
405+
406+
SPDX-License-Identifier: Apache-2.0

lib/earmark.ex

+2
Original file line numberDiff line numberDiff line change
@@ -372,3 +372,5 @@ defmodule Earmark do
372372
|> Enum.map(&Task.await/1)
373373
end
374374
end
375+
376+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/block.ex

+2
Original file line numberDiff line numberDiff line change
@@ -580,3 +580,5 @@ defmodule Earmark.Block do
580580
|> Enum.reverse
581581
end
582582
end
583+
584+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/cli.ex

+2
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,5 @@ defmodule Earmark.CLI do
9393
end
9494

9595
end
96+
97+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/context.ex

+2
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,5 @@ defmodule Earmark.Context do
147147
end
148148

149149
end
150+
151+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/error.ex

+2
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ defmodule Earmark.Error do
88
def exception(msg), do: %__MODULE__{message: msg}
99

1010
end
11+
12+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/helpers.ex

+2
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,5 @@ defmodule Earmark.Helpers do
6363

6464

6565
end
66+
67+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/helpers/attr_parser.ex

+2
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,5 @@ defmodule Earmark.Helpers.AttrParser do
5757
defp add_errors(context, errors, lnb), do: add_message(context, {:warning, lnb, "Illegal attributes #{inspect errors} ignored in IAL"})
5858

5959
end
60+
61+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/helpers/html_helpers.ex

+2
Original file line numberDiff line numberDiff line change
@@ -56,3 +56,5 @@ defmodule Earmark.Helpers.HtmlHelpers do
5656
end
5757

5858
end
59+
60+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/helpers/leex_helpers.ex

+2
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ defmodule Earmark.Helpers.LeexHelpers do
2525
defp elixirize_tokens([{token, _, text}|rest], result), do: elixirize_tokens(rest, [{token,to_string(text)}|result])
2626

2727
end
28+
29+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/helpers/line_helpers.ex

+2
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@ defmodule Earmark.Helpers.LineHelpers do
3737
def blank_line_in?([ _ | rest ]), do: blank_line_in?(rest)
3838

3939
end
40+
41+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/helpers/link_parser.ex

+2
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,5 @@ defmodule Earmark.Helpers.LinkParser do
107107

108108
defp list_to_text(lst), do: lst |> Enum.reverse() |> Enum.join("")
109109
end
110+
111+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/helpers/lookahead_helpers.ex

+2
Original file line numberDiff line numberDiff line change
@@ -171,3 +171,5 @@ defmodule Earmark.Helpers.LookaheadHelpers do
171171
%{ params | pending: pending, pending_lnb: pending_lnb }
172172
end
173173
end
174+
175+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/helpers/reparse_helpers.ex

+2
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,5 @@ defmodule Earmark.Helpers.ReparseHelpers do
5151
line.content
5252
end
5353
end
54+
55+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/helpers/string_helpers.ex

+2
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ defmodule Earmark.Helpers.StringHelpers do
2222
{lead, behead(str, lead)}
2323
end
2424
end
25+
26+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/helpers/yecc_helpers.ex

+2
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ defmodule Earmark.Helpers.YeccHelpers do
1414
end
1515
end
1616
end
17+
18+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/html_renderer.ex

+2
Original file line numberDiff line numberDiff line change
@@ -260,3 +260,5 @@ defmodule Earmark.HtmlRenderer do
260260
end
261261

262262
end
263+
264+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/inline.ex

+2
Original file line numberDiff line numberDiff line change
@@ -315,3 +315,5 @@
315315
{ rest, context, result, lnb + String.length(suffix) }
316316
end
317317
end
318+
319+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/line.ex

+2
Original file line numberDiff line numberDiff line change
@@ -249,3 +249,5 @@ defmodule Earmark.Line do
249249
end
250250

251251
end
252+
253+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/message.ex

+2
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,5 @@ defmodule Earmark.Message do
6060
end
6161

6262
end
63+
64+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/options.ex

+2
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ defmodule Earmark.Options do
3636
end
3737

3838
end
39+
40+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/parser.ex

+2
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,5 @@ defmodule Earmark.Parser do
7979
end
8080

8181
end
82+
83+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/plugin.ex

+2
Original file line numberDiff line numberDiff line change
@@ -135,3 +135,5 @@ defmodule Earmark.Plugin do
135135
end
136136
def define(options, plugin), do: define(options, {plugin, ""})
137137
end
138+
139+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/scanner.ex

+2
Original file line numberDiff line numberDiff line change
@@ -151,3 +151,5 @@ defmodule Earmark.Scanner do
151151
end
152152
end
153153
end
154+
155+
# SPDX-License-Identifier: Apache-2.0

lib/earmark/types.ex

+2
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ defmodule Earmark.Types do
1313
end
1414

1515
end
16+
17+
# SPDX-License-Identifier: Apache-2.0

mix.exs

+2
Original file line numberDiff line numberDiff line change
@@ -75,3 +75,5 @@ defmodule Earmark.Mixfile do
7575
Mix.Tasks.Readme.run(args)
7676
end
7777
end
78+
79+
# SPDX-License-Identifier: Apache-2.0

src/link_text_lexer.erl

+32-13
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
-file("/usr/local/Cellar/erlang/19.0.2/lib/erlang/lib/parsetools-2.1.2/include/leexinc.hrl", 0).
1+
-file("/usr/local/Cellar/erlang/20.1.5/lib/erlang/lib/parsetools-2.1.5/include/leexinc.hrl", 0).
22
%% The source of this file is part of leex distribution, as such it
33
%% has the same Copyright as the other files in the leex
44
%% distribution. The Copyright is defined in the accompanying file
@@ -16,7 +16,7 @@
1616

1717
dismiss_backslash([$\\|Chars]) -> Chars.
1818

19-
-file("/usr/local/Cellar/erlang/19.0.2/lib/erlang/lib/parsetools-2.1.2/include/leexinc.hrl", 14).
19+
-file("/usr/local/Cellar/erlang/20.1.5/lib/erlang/lib/parsetools-2.1.5/include/leexinc.hrl", 14).
2020

2121
format_error({illegal,S}) -> ["illegal characters ",io_lib:write_string(S)];
2222
format_error({user,S}) -> S.
@@ -37,12 +37,14 @@ string(Ics0, L0, Tcs, Ts) ->
3737
case yystate(yystate(), Ics0, L0, 0, reject, 0) of
3838
{A,Alen,Ics1,L1} -> % Accepting end state
3939
string_cont(Ics1, L1, yyaction(A, Alen, Tcs, L0), Ts);
40-
{A,Alen,Ics1,L1,_S1} -> % Accepting transition state
40+
{A,Alen,Ics1,L1,_S1} -> % Accepting transistion state
4141
string_cont(Ics1, L1, yyaction(A, Alen, Tcs, L0), Ts);
4242
{reject,_Alen,Tlen,_Ics1,L1,_S1} -> % After a non-accepting state
4343
{error,{L0,?MODULE,{illegal,yypre(Tcs, Tlen+1)}},L1};
44-
{A,Alen,_Tlen,_Ics1,_L1,_S1} ->
45-
string_cont(yysuf(Tcs, Alen), L0, yyaction(A, Alen, Tcs, L0), Ts)
44+
{A,Alen,Tlen,_Ics1,L1,_S1} ->
45+
Tcs1 = yysuf(Tcs, Alen),
46+
L2 = adjust_line(Tlen, Alen, Tcs1, L1),
47+
string_cont(Tcs1, L2, yyaction(A, Alen, Tcs, L0), Ts)
4648
end.
4749

4850
%% string_cont(RestChars, Line, Token, Tokens)
@@ -112,8 +114,10 @@ token(S0, Ics0, L0, Tcs, Tlen0, Tline, A0, Alen0) ->
112114
{reject,_Alen1,Tlen1,Ics1,L1,_S1} -> % No token match
113115
Error = {Tline,?MODULE,{illegal,yypre(Tcs, Tlen1+1)}},
114116
{done,{error,Error,L1},Ics1};
115-
{A1,Alen1,_Tlen1,_Ics1,_L1,_S1} -> % Use last accept match
116-
token_cont(yysuf(Tcs, Alen1), L0, yyaction(A1, Alen1, Tcs, Tline))
117+
{A1,Alen1,Tlen1,_Ics1,L1,_S1} -> % Use last accept match
118+
Tcs1 = yysuf(Tcs, Alen1),
119+
L2 = adjust_line(Tlen1, Alen1, Tcs1, L1),
120+
token_cont(Tcs1, L2, yyaction(A1, Alen1, Tcs, Tline))
117121
end.
118122

119123
%% token_cont(RestChars, Line, Token)
@@ -186,9 +190,11 @@ tokens(S0, Ics0, L0, Tcs, Tlen0, Tline, Ts, A0, Alen0) ->
186190
%% Skip rest of tokens.
187191
Error = {L1,?MODULE,{illegal,yypre(Tcs, Tlen1+1)}},
188192
skip_tokens(yysuf(Tcs, Tlen1+1), L1, Error);
189-
{A1,Alen1,_Tlen1,_Ics1,_L1,_S1} ->
193+
{A1,Alen1,Tlen1,_Ics1,L1,_S1} ->
190194
Token = yyaction(A1, Alen1, Tcs, Tline),
191-
tokens_cont(yysuf(Tcs, Alen1), L0, Token, Ts)
195+
Tcs1 = yysuf(Tcs, Alen1),
196+
L2 = adjust_line(Tlen1, Alen1, Tcs1, L1),
197+
tokens_cont(Tcs1, L2, Token, Ts)
192198
end.
193199

194200
%% tokens_cont(RestChars, Line, Token, Tokens)
@@ -240,9 +246,11 @@ skip_tokens(S0, Ics0, L0, Tcs, Tlen0, Tline, Error, A0, Alen0) ->
240246
{done,{error,Error,L1},eof};
241247
{reject,_Alen1,Tlen1,_Ics1,L1,_S1} ->
242248
skip_tokens(yysuf(Tcs, Tlen1+1), L1, Error);
243-
{A1,Alen1,_Tlen1,_Ics1,L1,_S1} ->
249+
{A1,Alen1,Tlen1,_Ics1,L1,_S1} ->
244250
Token = yyaction(A1, Alen1, Tcs, Tline),
245-
skip_cont(yysuf(Tcs, Alen1), L1, Token, Error)
251+
Tcs1 = yysuf(Tcs, Alen1),
252+
L2 = adjust_line(Tlen1, Alen1, Tcs1, L1),
253+
skip_cont(Tcs1, L2, Token, Error)
246254
end.
247255

248256
%% skip_cont(RestChars, Line, Token, Error)
@@ -274,6 +282,17 @@ yyrev(List, Tail) -> lists:reverse(List, Tail).
274282
yypre(List, N) -> lists:sublist(List, N).
275283
yysuf(List, N) -> lists:nthtail(N, List).
276284

285+
%% adjust_line(TokenLength, AcceptLength, Chars, Line) -> NewLine
286+
%% Make sure that newlines in Chars are not counted twice.
287+
%% Line has been updated with respect to newlines in the prefix of
288+
%% Chars consisting of (TokenLength - AcceptLength) characters.
289+
290+
adjust_line(N, N, _Cs, L) -> L;
291+
adjust_line(T, A, [$\n|Cs], L) ->
292+
adjust_line(T-1, A, Cs, L-1);
293+
adjust_line(T, A, [_|Cs], L) ->
294+
adjust_line(T-1, A, Cs, L).
295+
277296
%% yystate() -> InitialState.
278297
%% yystate(State, InChars, Line, CurrTokLen, AcceptAction, AcceptLen) ->
279298
%% {Action, AcceptLen, RestChars, Line} |
@@ -284,7 +303,7 @@ yysuf(List, N) -> lists:nthtail(N, List).
284303
%% return signal either an unrecognised character or end of current
285304
%% input.
286305

287-
-file("src/link_text_lexer.erl", 286).
306+
-file("src/link_text_lexer.erl", 305).
288307
yystate() -> 10.
289308

290309
yystate(11, [33|Ics], Line, Tlen, _, _) ->
@@ -476,4 +495,4 @@ yyaction_9(TokenChars, TokenLine) ->
476495
yyaction_10(TokenChars, TokenLine) ->
477496
{ token, { verbatim, TokenLine, TokenChars } } .
478497

479-
-file("/usr/local/Cellar/erlang/19.0.2/lib/erlang/lib/parsetools-2.1.2/include/leexinc.hrl", 290).
498+
-file("/usr/local/Cellar/erlang/20.1.5/lib/erlang/lib/parsetools-2.1.5/include/leexinc.hrl", 309).

src/link_text_parser.erl

+11-10
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,13 @@ make_image_tuple({L, R}) -> {L, string:concat("!", R)}.
1414

1515
title_tuple({Title, Parsed}) -> {Title, string:join(["[", Parsed, "]"], "")}.
1616

17-
-file("/home/robert/.asdf/installs/erlang/19.1/lib/erlang/lib/parsetools-2.1.3/include/yeccpre.hrl", 0).
17+
%% SPDX-License-Identifier: Apache-2.0
18+
19+
-file("/usr/local/Cellar/erlang/20.1.5/lib/erlang/lib/parsetools-2.1.5/include/yeccpre.hrl", 0).
1820
%%
1921
%% %CopyrightBegin%
2022
%%
21-
%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
23+
%% Copyright Ericsson AB 1996-2017. All Rights Reserved.
2224
%%
2325
%% Licensed under the Apache License, Version 2.0 (the "License");
2426
%% you may not use this file except in compliance with the License.
@@ -168,27 +170,26 @@ yecctoken_location(Token) ->
168170
end.
169171

170172
-compile({nowarn_unused_function, yecctoken2string/1}).
171-
yecctoken2string({atom, _, A}) -> io_lib:write(A);
173+
yecctoken2string({atom, _, A}) -> io_lib:write_atom(A);
172174
yecctoken2string({integer,_,N}) -> io_lib:write(N);
173175
yecctoken2string({float,_,F}) -> io_lib:write(F);
174176
yecctoken2string({char,_,C}) -> io_lib:write_char(C);
175177
yecctoken2string({var,_,V}) -> io_lib:format("~s", [V]);
176178
yecctoken2string({string,_,S}) -> io_lib:write_string(S);
177179
yecctoken2string({reserved_symbol, _, A}) -> io_lib:write(A);
178-
yecctoken2string({_Cat, _, Val}) -> io_lib:format("~p",[Val]);
180+
yecctoken2string({_Cat, _, Val}) -> io_lib:format("~tp", [Val]);
179181
yecctoken2string({dot, _}) -> "'.'";
180-
yecctoken2string({'$end', _}) ->
181-
[];
182+
yecctoken2string({'$end', _}) -> [];
182183
yecctoken2string({Other, _}) when is_atom(Other) ->
183-
io_lib:write(Other);
184+
io_lib:write_atom(Other);
184185
yecctoken2string(Other) ->
185-
io_lib:write(Other).
186+
io_lib:format("~tp", [Other]).
186187

187188
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
188189

189190

190191

191-
-file("src/link_text_parser.erl", 191).
192+
-file("src/link_text_parser.erl", 192).
192193

193194
-dialyzer({nowarn_function, yeccpars2/7}).
194195
yeccpars2(0=S, Cat, Ss, Stack, T, Ts, Tzr) ->
@@ -766,4 +767,4 @@ yeccpars2_34_(__Stack0) ->
766767
end | __Stack].
767768

768769

769-
-file("src/link_text_parser.yrl", 56).
770+
-file("src/link_text_parser.yrl", 58).

src/link_text_parser.yrl

+2
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,5 @@ extract_token({_Token, _Line, Value}) -> {Value, Value}.
5353
make_image_tuple({L, R}) -> {L, string:concat("!", R)}.
5454

5555
title_tuple({Title, Parsed}) -> {Title, string:join(["[", Parsed, "]"], "")}.
56+
57+
%% SPDX-License-Identifier: Apache-2.0

tasks/docs.exs

+1
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ defmodule Mix.Tasks.Docs do
3535
end
3636

3737

38+
# SPDX-License-Identifier: Apache-2.0

tasks/readme.exs

+1
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,4 @@ defmodule Mix.Tasks.Readme do
105105
end
106106

107107

108+
# SPDX-License-Identifier: Apache-2.0

test/acceptance/atx_headers_test.exs

+2
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,5 @@ defmodule Acceptance.AtxHeadersTest do
7777

7878
# end
7979
end
80+
81+
# SPDX-License-Identifier: Apache-2.0

test/acceptance/block_ial_test.exs

+2
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,5 @@ defmodule Acceptance.BlockIalTest do
7171

7272
end
7373
end
74+
75+
# SPDX-License-Identifier: Apache-2.0

test/acceptance/block_quotes_test.exs

+2
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ defmodule Acceptance.BlockQuotesTest do
3636

3737
# end
3838
end
39+
40+
# SPDX-License-Identifier: Apache-2.0

test/acceptance/diverse_test.exs

+2
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,5 @@ defmodule Acceptance.DiverseTest do
3030
end
3131

3232
end
33+
34+
# SPDX-License-Identifier: Apache-2.0

test/acceptance/emphasis_test.exs

+2
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,5 @@ defmodule Acceptance.EmphasisTest do
102102

103103
# end
104104
end
105+
106+
# SPDX-License-Identifier: Apache-2.0

test/acceptance/escape_test.exs

+2
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,5 @@ defmodule Acceptance.EscapeTest do
5555
end
5656
# end
5757
end
58+
59+
# SPDX-License-Identifier: Apache-2.0

test/acceptance/fenced_code_blocks_test.exs

+2
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,5 @@ defmodule Acceptance.FencedCodeBlocksTest do
4646

4747
# end
4848
end
49+
50+
# SPDX-License-Identifier: Apache-2.0

test/acceptance/footnotes_test.exs

+2
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,5 @@ defmodule Acceptance.FootnotesTest do
4343
# end
4444

4545
end
46+
47+
# SPDX-License-Identifier: Apache-2.0

0 commit comments

Comments
 (0)