Move the "Generated by ..." comment out of wrapping functions
The wrapping functions are also generated by PEG.js, so the comment should be above them to mark them as such. This shouldn't cause any problems technically.
This commit is contained in:
parent
f934199fba
commit
057a93fbc7
|
@ -1140,10 +1140,8 @@ function generateJS(ast, options) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function generateWrapper(toplevelCode) {
|
function generateWrapper(toplevelCode) {
|
||||||
function generateIntro() {
|
function generateGeneratedByComment() {
|
||||||
return [
|
return [
|
||||||
'"use strict";',
|
|
||||||
'',
|
|
||||||
'/*',
|
'/*',
|
||||||
' * Generated by PEG.js 0.9.0.',
|
' * Generated by PEG.js 0.9.0.',
|
||||||
' *',
|
' *',
|
||||||
|
@ -1172,8 +1170,9 @@ function generateJS(ast, options) {
|
||||||
var generators = {
|
var generators = {
|
||||||
bare: function() {
|
bare: function() {
|
||||||
return [
|
return [
|
||||||
|
generateGeneratedByComment(),
|
||||||
'(function() {',
|
'(function() {',
|
||||||
indent2(generateIntro()),
|
' "use strict";',
|
||||||
'',
|
'',
|
||||||
indent2(toplevelCode),
|
indent2(toplevelCode),
|
||||||
'',
|
'',
|
||||||
|
@ -1199,6 +1198,7 @@ function generateJS(ast, options) {
|
||||||
params = dependencyVars.join(', ');
|
params = dependencyVars.join(', ');
|
||||||
|
|
||||||
parts.push([
|
parts.push([
|
||||||
|
generateGeneratedByComment(),
|
||||||
'(function(root, factory) {',
|
'(function(root, factory) {',
|
||||||
' if (typeof define === "function" && define.amd) {',
|
' if (typeof define === "function" && define.amd) {',
|
||||||
' define(' + dependencies + ', factory);',
|
' define(' + dependencies + ', factory);',
|
||||||
|
@ -1216,7 +1216,7 @@ function generateJS(ast, options) {
|
||||||
parts.push([
|
parts.push([
|
||||||
' }',
|
' }',
|
||||||
'})(this, function(' + params + ') {',
|
'})(this, function(' + params + ') {',
|
||||||
indent2(generateIntro()),
|
' "use strict";',
|
||||||
'',
|
'',
|
||||||
indent2(toplevelCode),
|
indent2(toplevelCode),
|
||||||
'',
|
'',
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
/* eslint-env node, amd */
|
/* eslint-env node, amd */
|
||||||
/* eslint no-unused-vars: 0 */
|
/* eslint no-unused-vars: 0 */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Generated by PEG.js 0.9.0.
|
||||||
|
*
|
||||||
|
* http://pegjs.org/
|
||||||
|
*/
|
||||||
(function(root, factory) {
|
(function(root, factory) {
|
||||||
if (typeof define === "function" && define.amd) {
|
if (typeof define === "function" && define.amd) {
|
||||||
define([], factory);
|
define([], factory);
|
||||||
|
@ -10,12 +15,6 @@
|
||||||
})(this, function() {
|
})(this, function() {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
/*
|
|
||||||
* Generated by PEG.js 0.9.0.
|
|
||||||
*
|
|
||||||
* http://pegjs.org/
|
|
||||||
*/
|
|
||||||
|
|
||||||
function peg$subclass(child, parent) {
|
function peg$subclass(child, parent) {
|
||||||
function ctor() { this.constructor = child; }
|
function ctor() { this.constructor = child; }
|
||||||
ctor.prototype = parent.prototype;
|
ctor.prototype = parent.prototype;
|
||||||
|
|
Loading…
Reference in a new issue