Skip to content

Commit 3d8ae1d

Browse files
committed
made sure all source files have closure compiler compatible @license header comments
1 parent 2f52d8b commit 3d8ae1d

15 files changed

+197
-81
lines changed

distrib/prettify-small.tar.bz2

165 Bytes
Binary file not shown.

distrib/prettify-small.tgz

112 Bytes
Binary file not shown.

distrib/prettify-small.zip

1.74 KB
Binary file not shown.

js-modules/prettify.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
// Copyright (C) 2006 Google Inc.
2-
//
3-
// Licensed under the Apache License, Version 2.0 (the "License");
4-
// you may not use this file except in compliance with the License.
5-
// You may obtain a copy of the License at
6-
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
// See the License for the specific language governing permissions and
13-
// limitations under the License.
14-
1+
/**
2+
* @license
3+
* Copyright (C) 2006 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
1517

1618
/**
1719
* @fileoverview

loader/lang-lasso.js

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

loader/lang-swift.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
/*
2+
3+
Copyright (C) 2015 Google Inc.
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
*/
115
var a=null;
216
PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\0\t-\r ]+/,a," \n\r\t\u000b\u000c\0"],["str",/^"(?:[^"\\]|\\.|\\\((?:[^")\\]|\\.)*\))*"/,a,'"']],[["lit",/^(?:0x[\dA-Fa-f][\dA-F_a-f]*\.[\dA-Fa-f][\dA-F_a-f]*[Pp]?|\d[\d_]*\.\d[\d_]*[Ee]?)[+-]?\d[\d_]*/,a],["lit",/^-?(?:0(?:b[01][01_]*|o[0-7][0-7_]*|x[\dA-Fa-f][\dA-F_a-f]*)|\d[\d_]*)/,a],["lit",/^(?:true|false|nil)\b/,a],["kwd",/^\b(?:__COLUMN__|__FILE__|__FUNCTION__|__LINE__|#available|#else|#elseif|#endif|#if|#line|arch|arm|arm64|associativity|as|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|dynamicType|else|enum|fallthrough|final|for|func|get|import|indirect|infix|init|inout|internal|i386|if|in|iOS|iOSApplicationExtension|is|lazy|left|let|mutating|none|nonmutating|operator|optional|OSX|OSXApplicationExtension|override|postfix|precedence|prefix|private|protocol|Protocol|public|required|rethrows|return|right|safe|self|set|static|struct|subscript|super|switch|throw|try|Type|typealias|unowned|unsafe|var|weak|watchOS|while|willSet|x86_64)\b/,a],
317
["com",/^\/\/.*?[\n\r]/,a],["com",/^\/\*[\S\s]*?(?:\*\/|$)/,a],["pun",/^<<=|<=|<<|>>=|>=|>>|===|==|\.\.\.|&&=|\.\.<|!==|!=|&=|~=|[#(),.:;@[\]{}~]|\|\|=|\?\?|\|\||&&|&\*|&\+|&-|&=|\+=|-=|\/=|\*=|\^=|%=|\|=|->|`|==|\+\+|--|[!%&*+/<-?^_|-]/,a],["typ",/^\b(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,a]]),["swift"]);

loader/lang-xq.js

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

loader/prettify.js

Lines changed: 17 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

loader/run_prettify.js

Lines changed: 17 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lang-lasso.js

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
// Copyright (C) 2013 Eric Knibbe
2-
//
3-
// Licensed under the Apache License, Version 2.0 (the "License");
4-
// you may not use this file except in compliance with the License.
5-
// You may obtain a copy of the License at
6-
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
// See the License for the specific language governing permissions and
13-
// limitations under the License.
14-
1+
/**
2+
* @license
3+
* Copyright (C) 2013 Eric Knibbe
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
1517

1618
/**
1719
* @fileoverview

src/lang-swift.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/**
2+
* @license
23
* Copyright (C) 2015 Google Inc.
34
* Licensed under the Apache License, Version 2.0 (the "License");
45
* you may not use this file except in compliance with the License.

src/lang-xq.js

Lines changed: 16 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/prettify.js

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
// Copyright (C) 2006 Google Inc.
2-
//
3-
// Licensed under the Apache License, Version 2.0 (the "License");
4-
// you may not use this file except in compliance with the License.
5-
// You may obtain a copy of the License at
6-
//
7-
// http://www.apache.org/licenses/LICENSE-2.0
8-
//
9-
// Unless required by applicable law or agreed to in writing, software
10-
// distributed under the License is distributed on an "AS IS" BASIS,
11-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12-
// See the License for the specific language governing permissions and
13-
// limitations under the License.
14-
1+
/**
2+
* @license
3+
* Copyright (C) 2006 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
1517

1618
/**
1719
* @fileoverview
@@ -982,10 +984,14 @@ var prettyPrint;
982984
* HTMLOListElement, and each line is moved into a separate list item.
983985
* This requires cloning elements, so the input might not have unique
984986
* IDs after numbering.
987+
* @param {number|null|boolean} startLineNum
988+
* If truthy, coerced to an integer which is the 1-indexed line number
989+
* of the first line of code. The number of the first line will be
990+
* attached to the list.
985991
* @param {boolean} isPreformatted true iff white-space in text nodes should
986992
* be treated as significant.
987993
*/
988-
function numberLines(node, opt_startLineNum, isPreformatted) {
994+
function numberLines(node, startLineNum, isPreformatted) {
989995
var nocode = /(?:^|\s)nocode(?:\s|$)/;
990996
var lineBreak = /\r\n?|\n/;
991997

@@ -1086,13 +1092,13 @@ var prettyPrint;
10861092
}
10871093

10881094
// Make sure numeric indices show correctly.
1089-
if (opt_startLineNum === (opt_startLineNum|0)) {
1090-
listItems[0].setAttribute('value', opt_startLineNum);
1095+
if (startLineNum === (startLineNum|0)) {
1096+
listItems[0].setAttribute('value', startLineNum);
10911097
}
10921098

10931099
var ol = document.createElement('ol');
10941100
ol.className = 'linenums';
1095-
var offset = Math.max(0, ((opt_startLineNum - 1 /* zero index */)) | 0) || 0;
1101+
var offset = Math.max(0, ((startLineNum - 1 /* zero index */)) | 0) || 0;
10961102
for (var i = 0, n = listItems.length; i < n; ++i) {
10971103
li = listItems[i];
10981104
// Stick a class on the LIs so that stylesheets can
@@ -1107,6 +1113,7 @@ var prettyPrint;
11071113

11081114
node.appendChild(ol);
11091115
}
1116+
11101117
/**
11111118
* Breaks {@code job.sourceCode} around style boundaries in
11121119
* {@code job.decorations} and modifies {@code job.sourceNode} in place.

src/run_prettify.js

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -224,20 +224,22 @@ var IN_GLOBAL_SCOPE = false;
224224
loadStylesheetsFallingBack(skinUrls);
225225

226226
var prettyPrint = (function () {
227-
// Copyright (C) 2006 Google Inc.
228-
//
229-
// Licensed under the Apache License, Version 2.0 (the "License");
230-
// you may not use this file except in compliance with the License.
231-
// You may obtain a copy of the License at
232-
//
233-
// http://www.apache.org/licenses/LICENSE-2.0
234-
//
235-
// Unless required by applicable law or agreed to in writing, software
236-
// distributed under the License is distributed on an "AS IS" BASIS,
237-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
238-
// See the License for the specific language governing permissions and
239-
// limitations under the License.
240-
227+
/**
228+
* @license
229+
* Copyright (C) 2006 Google Inc.
230+
*
231+
* Licensed under the Apache License, Version 2.0 (the "License");
232+
* you may not use this file except in compliance with the License.
233+
* You may obtain a copy of the License at
234+
*
235+
* http://www.apache.org/licenses/LICENSE-2.0
236+
*
237+
* Unless required by applicable law or agreed to in writing, software
238+
* distributed under the License is distributed on an "AS IS" BASIS,
239+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
240+
* See the License for the specific language governing permissions and
241+
* limitations under the License.
242+
*/
241243

242244
/**
243245
* @fileoverview
@@ -1205,10 +1207,14 @@ var IN_GLOBAL_SCOPE = false;
12051207
* HTMLOListElement, and each line is moved into a separate list item.
12061208
* This requires cloning elements, so the input might not have unique
12071209
* IDs after numbering.
1210+
* @param {number|null|boolean} startLineNum
1211+
* If truthy, coerced to an integer which is the 1-indexed line number
1212+
* of the first line of code. The number of the first line will be
1213+
* attached to the list.
12081214
* @param {boolean} isPreformatted true iff white-space in text nodes should
12091215
* be treated as significant.
12101216
*/
1211-
function numberLines(node, opt_startLineNum, isPreformatted) {
1217+
function numberLines(node, startLineNum, isPreformatted) {
12121218
var nocode = /(?:^|\s)nocode(?:\s|$)/;
12131219
var lineBreak = /\r\n?|\n/;
12141220

@@ -1309,13 +1315,13 @@ var IN_GLOBAL_SCOPE = false;
13091315
}
13101316

13111317
// Make sure numeric indices show correctly.
1312-
if (opt_startLineNum === (opt_startLineNum|0)) {
1313-
listItems[0].setAttribute('value', opt_startLineNum);
1318+
if (startLineNum === (startLineNum|0)) {
1319+
listItems[0].setAttribute('value', startLineNum);
13141320
}
13151321

13161322
var ol = document.createElement('ol');
13171323
ol.className = 'linenums';
1318-
var offset = Math.max(0, ((opt_startLineNum - 1 /* zero index */)) | 0) || 0;
1324+
var offset = Math.max(0, ((startLineNum - 1 /* zero index */)) | 0) || 0;
13191325
for (var i = 0, n = listItems.length; i < n; ++i) {
13201326
li = listItems[i];
13211327
// Stick a class on the LIs so that stylesheets can
@@ -1329,7 +1335,8 @@ var IN_GLOBAL_SCOPE = false;
13291335
}
13301336

13311337
node.appendChild(ol);
1332-
}
1338+
}
1339+
13331340
/**
13341341
* Breaks {@code job.sourceCode} around style boundaries in
13351342
* {@code job.decorations} and modifies {@code job.sourceNode} in place.

tests/test_base.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
/**
2+
* @license
3+
* Copyright (C) 2015 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
118
// get accurate timing.
219
// This file must be loaded after prettify.js for this to work.
320
PR_SHOULD_USE_CONTINUATION = false;

0 commit comments

Comments
 (0)