Regenerating node_modules
This commit is contained in:
parent
09b4a82c83
commit
c96f84308a
5488 changed files with 487362 additions and 60779 deletions
19
node_modules/doctrine/LICENSE.BSD
generated
vendored
19
node_modules/doctrine/LICENSE.BSD
generated
vendored
|
|
@ -1,19 +0,0 @@
|
|||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
202
node_modules/doctrine/LICENSE.closure-compiler
generated
vendored
202
node_modules/doctrine/LICENSE.closure-compiler
generated
vendored
|
|
@ -1,202 +0,0 @@
|
|||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
19
node_modules/doctrine/LICENSE.esprima
generated
vendored
19
node_modules/doctrine/LICENSE.esprima
generated
vendored
|
|
@ -1,19 +0,0 @@
|
|||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
174
node_modules/doctrine/README.md
generated
vendored
174
node_modules/doctrine/README.md
generated
vendored
|
|
@ -1,174 +0,0 @@
|
|||
[![NPM version][npm-image]][npm-url]
|
||||
[![build status][travis-image]][travis-url]
|
||||
[![Test coverage][coveralls-image]][coveralls-url]
|
||||
[![Downloads][downloads-image]][downloads-url]
|
||||
[](https://gitter.im/eslint/doctrine?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
# Doctrine
|
||||
|
||||
Doctrine is a [JSDoc](http://usejsdoc.org) parser that parses documentation comments from JavaScript (you need to pass in the comment, not a whole JavaScript file).
|
||||
|
||||
## Installation
|
||||
|
||||
You can install Doctrine using [npm](https://npmjs.com):
|
||||
|
||||
```
|
||||
$ npm install doctrine --save-dev
|
||||
```
|
||||
|
||||
Doctrine can also be used in web browsers using [Browserify](http://browserify.org).
|
||||
|
||||
## Usage
|
||||
|
||||
Require doctrine inside of your JavaScript:
|
||||
|
||||
```js
|
||||
var doctrine = require("doctrine");
|
||||
```
|
||||
|
||||
### parse()
|
||||
|
||||
The primary method is `parse()`, which accepts two arguments: the JSDoc comment to parse and an optional options object. The available options are:
|
||||
|
||||
* `unwrap` - set to `true` to delete the leading `/**`, any `*` that begins a line, and the trailing `*/` from the source text. Default: `false`.
|
||||
* `tags` - an array of tags to return. When specified, Doctrine returns only tags in this array. For example, if `tags` is `["param"]`, then only `@param` tags will be returned. Default: `null`.
|
||||
* `recoverable` - set to `true` to keep parsing even when syntax errors occur. Default: `false`.
|
||||
* `sloppy` - set to `true` to allow optional parameters to be specified in brackets (`@param {string} [foo]`). Default: `false`.
|
||||
* `lineNumberes` - set to `true` to add `lineNumber` to each node, specifying the line on which the node is found in the source. Default: `false`.
|
||||
|
||||
Here's a simple example:
|
||||
|
||||
```js
|
||||
var ast = doctrine.parse(
|
||||
[
|
||||
"/**",
|
||||
" * This function comment is parsed by doctrine",
|
||||
" * @param {{ok:String}} userName",
|
||||
"*/"
|
||||
].join('\n'), { unwrap: true });
|
||||
```
|
||||
|
||||
This example returns the following AST:
|
||||
|
||||
{
|
||||
"description": "This function comment is parsed by doctrine",
|
||||
"tags": [
|
||||
{
|
||||
"title": "param",
|
||||
"description": null,
|
||||
"type": {
|
||||
"type": "RecordType",
|
||||
"fields": [
|
||||
{
|
||||
"type": "FieldType",
|
||||
"key": "ok",
|
||||
"value": {
|
||||
"type": "NameExpression",
|
||||
"name": "String"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"name": "userName"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
See the [demo page](http://eslint.org/doctrine/demo/) more detail.
|
||||
|
||||
## Team
|
||||
|
||||
These folks keep the project moving and are resources for help:
|
||||
|
||||
* Nicholas C. Zakas ([@nzakas](https://github.com/nzakas)) - project lead
|
||||
* Yusuke Suzuki ([@constellation](https://github.com/constellation)) - reviewer
|
||||
|
||||
## Contributing
|
||||
|
||||
Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/doctrine/issues).
|
||||
|
||||
## Frequently Asked Questions
|
||||
|
||||
### Can I pass a whole JavaScript file to Doctrine?
|
||||
|
||||
No. Doctrine can only parse JSDoc comments, so you'll need to pass just the JSDoc comment to Doctrine in order to work.
|
||||
|
||||
|
||||
### License
|
||||
|
||||
#### doctrine
|
||||
|
||||
Copyright (C) 2012 [Yusuke Suzuki](http://github.com/Constellation)
|
||||
(twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
#### esprima
|
||||
|
||||
some of functions is derived from esprima
|
||||
|
||||
Copyright (C) 2012, 2011 [Ariya Hidayat](http://ariya.ofilabs.com/about)
|
||||
(twitter: [@ariyahidayat](http://twitter.com/ariyahidayat)) and other contributors.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
#### closure-compiler
|
||||
|
||||
some of extensions is derived from closure-compiler
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
|
||||
### Where to ask for help?
|
||||
|
||||
Join our [Chatroom](https://gitter.im/eslint/doctrine)
|
||||
|
||||
[npm-image]: https://img.shields.io/npm/v/doctrine.svg?style=flat-square
|
||||
[npm-url]: https://www.npmjs.com/package/doctrine
|
||||
[travis-image]: https://img.shields.io/travis/eslint/doctrine/master.svg?style=flat-square
|
||||
[travis-url]: https://travis-ci.org/eslint/doctrine
|
||||
[coveralls-image]: https://img.shields.io/coveralls/eslint/doctrine/master.svg?style=flat-square
|
||||
[coveralls-url]: https://coveralls.io/r/eslint/doctrine?branch=master
|
||||
[downloads-image]: http://img.shields.io/npm/dm/doctrine.svg?style=flat-square
|
||||
[downloads-url]: https://www.npmjs.com/package/doctrine
|
||||
833
node_modules/doctrine/lib/doctrine.js
generated
vendored
833
node_modules/doctrine/lib/doctrine.js
generated
vendored
|
|
@ -1,833 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2012-2014 Yusuke Suzuki <utatane.tea@gmail.com>
|
||||
Copyright (C) 2014 Dan Tao <daniel.tao@gmail.com>
|
||||
Copyright (C) 2013 Andrew Eisenberg <andrew@eisenberg.as>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var typed,
|
||||
utility,
|
||||
isArray,
|
||||
jsdoc,
|
||||
esutils,
|
||||
hasOwnProperty;
|
||||
|
||||
esutils = require('esutils');
|
||||
isArray = require('isarray');
|
||||
typed = require('./typed');
|
||||
utility = require('./utility');
|
||||
|
||||
function sliceSource(source, index, last) {
|
||||
return source.slice(index, last);
|
||||
}
|
||||
|
||||
hasOwnProperty = (function () {
|
||||
var func = Object.prototype.hasOwnProperty;
|
||||
return function hasOwnProperty(obj, name) {
|
||||
return func.call(obj, name);
|
||||
};
|
||||
}());
|
||||
|
||||
function shallowCopy(obj) {
|
||||
var ret = {}, key;
|
||||
for (key in obj) {
|
||||
if (obj.hasOwnProperty(key)) {
|
||||
ret[key] = obj[key];
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
function isASCIIAlphanumeric(ch) {
|
||||
return (ch >= 0x61 /* 'a' */ && ch <= 0x7A /* 'z' */) ||
|
||||
(ch >= 0x41 /* 'A' */ && ch <= 0x5A /* 'Z' */) ||
|
||||
(ch >= 0x30 /* '0' */ && ch <= 0x39 /* '9' */);
|
||||
}
|
||||
|
||||
function isParamTitle(title) {
|
||||
return title === 'param' || title === 'argument' || title === 'arg';
|
||||
}
|
||||
|
||||
function isReturnTitle(title) {
|
||||
return title === 'return' || title === 'returns';
|
||||
}
|
||||
|
||||
function isProperty(title) {
|
||||
return title === 'property' || title === 'prop';
|
||||
}
|
||||
|
||||
function isNameParameterRequired(title) {
|
||||
return isParamTitle(title) || isProperty(title) ||
|
||||
title === 'alias' || title === 'this' || title === 'mixes' || title === 'requires';
|
||||
}
|
||||
|
||||
function isAllowedName(title) {
|
||||
return isNameParameterRequired(title) || title === 'const' || title === 'constant';
|
||||
}
|
||||
|
||||
function isAllowedNested(title) {
|
||||
return isProperty(title) || isParamTitle(title);
|
||||
}
|
||||
|
||||
function isTypeParameterRequired(title) {
|
||||
return isParamTitle(title) || isReturnTitle(title) ||
|
||||
title === 'define' || title === 'enum' ||
|
||||
title === 'implements' || title === 'this' ||
|
||||
title === 'type' || title === 'typedef' || isProperty(title);
|
||||
}
|
||||
|
||||
// Consider deprecation instead using 'isTypeParameterRequired' and 'Rules' declaration to pick when a type is optional/required
|
||||
// This would require changes to 'parseType'
|
||||
function isAllowedType(title) {
|
||||
return isTypeParameterRequired(title) || title === 'throws' || title === 'const' || title === 'constant' ||
|
||||
title === 'namespace' || title === 'member' || title === 'var' || title === 'module' ||
|
||||
title === 'constructor' || title === 'class' || title === 'extends' || title === 'augments' ||
|
||||
title === 'public' || title === 'private' || title === 'protected';
|
||||
}
|
||||
|
||||
function trim(str) {
|
||||
return str.replace(/^\s+/, '').replace(/\s+$/, '');
|
||||
}
|
||||
|
||||
function unwrapComment(doc) {
|
||||
// JSDoc comment is following form
|
||||
// /**
|
||||
// * .......
|
||||
// */
|
||||
// remove /**, */ and *
|
||||
var BEFORE_STAR = 0,
|
||||
STAR = 1,
|
||||
AFTER_STAR = 2,
|
||||
index,
|
||||
len,
|
||||
mode,
|
||||
result,
|
||||
ch;
|
||||
|
||||
doc = doc.replace(/^\/\*\*?/, '').replace(/\*\/$/, '');
|
||||
index = 0;
|
||||
len = doc.length;
|
||||
mode = BEFORE_STAR;
|
||||
result = '';
|
||||
|
||||
while (index < len) {
|
||||
ch = doc.charCodeAt(index);
|
||||
switch (mode) {
|
||||
case BEFORE_STAR:
|
||||
if (esutils.code.isLineTerminator(ch)) {
|
||||
result += String.fromCharCode(ch);
|
||||
} else if (ch === 0x2A /* '*' */) {
|
||||
mode = STAR;
|
||||
} else if (!esutils.code.isWhiteSpace(ch)) {
|
||||
result += String.fromCharCode(ch);
|
||||
mode = AFTER_STAR;
|
||||
}
|
||||
break;
|
||||
|
||||
case STAR:
|
||||
if (!esutils.code.isWhiteSpace(ch)) {
|
||||
result += String.fromCharCode(ch);
|
||||
}
|
||||
mode = esutils.code.isLineTerminator(ch) ? BEFORE_STAR : AFTER_STAR;
|
||||
break;
|
||||
|
||||
case AFTER_STAR:
|
||||
result += String.fromCharCode(ch);
|
||||
if (esutils.code.isLineTerminator(ch)) {
|
||||
mode = BEFORE_STAR;
|
||||
}
|
||||
break;
|
||||
}
|
||||
index += 1;
|
||||
}
|
||||
|
||||
return result.replace(/\s+$/, '');
|
||||
}
|
||||
|
||||
// JSDoc Tag Parser
|
||||
|
||||
(function (exports) {
|
||||
var Rules,
|
||||
index,
|
||||
lineNumber,
|
||||
length,
|
||||
source,
|
||||
recoverable,
|
||||
sloppy,
|
||||
strict;
|
||||
|
||||
function advance() {
|
||||
var ch = source.charCodeAt(index);
|
||||
index += 1;
|
||||
if (esutils.code.isLineTerminator(ch) && !(ch === 0x0D /* '\r' */ && source.charCodeAt(index) === 0x0A /* '\n' */)) {
|
||||
lineNumber += 1;
|
||||
}
|
||||
return String.fromCharCode(ch);
|
||||
}
|
||||
|
||||
function scanTitle() {
|
||||
var title = '';
|
||||
// waste '@'
|
||||
advance();
|
||||
|
||||
while (index < length && isASCIIAlphanumeric(source.charCodeAt(index))) {
|
||||
title += advance();
|
||||
}
|
||||
|
||||
return title;
|
||||
}
|
||||
|
||||
function seekContent() {
|
||||
var ch, waiting, last = index;
|
||||
|
||||
waiting = false;
|
||||
while (last < length) {
|
||||
ch = source.charCodeAt(last);
|
||||
if (esutils.code.isLineTerminator(ch) && !(ch === 0x0D /* '\r' */ && source.charCodeAt(last + 1) === 0x0A /* '\n' */)) {
|
||||
waiting = true;
|
||||
} else if (waiting) {
|
||||
if (ch === 0x40 /* '@' */) {
|
||||
break;
|
||||
}
|
||||
if (!esutils.code.isWhiteSpace(ch)) {
|
||||
waiting = false;
|
||||
}
|
||||
}
|
||||
last += 1;
|
||||
}
|
||||
return last;
|
||||
}
|
||||
|
||||
// type expression may have nest brace, such as,
|
||||
// { { ok: string } }
|
||||
//
|
||||
// therefore, scanning type expression with balancing braces.
|
||||
function parseType(title, last) {
|
||||
var ch, brace, type, direct = false;
|
||||
|
||||
|
||||
// search '{'
|
||||
while (index < last) {
|
||||
ch = source.charCodeAt(index);
|
||||
if (esutils.code.isWhiteSpace(ch)) {
|
||||
advance();
|
||||
} else if (ch === 0x7B /* '{' */) {
|
||||
advance();
|
||||
break;
|
||||
} else {
|
||||
// this is direct pattern
|
||||
direct = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (direct) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// type expression { is found
|
||||
brace = 1;
|
||||
type = '';
|
||||
while (index < last) {
|
||||
ch = source.charCodeAt(index);
|
||||
if (esutils.code.isLineTerminator(ch)) {
|
||||
advance();
|
||||
} else {
|
||||
if (ch === 0x7D /* '}' */) {
|
||||
brace -= 1;
|
||||
if (brace === 0) {
|
||||
advance();
|
||||
break;
|
||||
}
|
||||
} else if (ch === 0x7B /* '{' */) {
|
||||
brace += 1;
|
||||
}
|
||||
type += advance();
|
||||
}
|
||||
}
|
||||
|
||||
if (brace !== 0) {
|
||||
// braces is not balanced
|
||||
return utility.throwError('Braces are not balanced');
|
||||
}
|
||||
|
||||
if (isParamTitle(title)) {
|
||||
return typed.parseParamType(type);
|
||||
}
|
||||
return typed.parseType(type);
|
||||
}
|
||||
|
||||
function scanIdentifier(last) {
|
||||
var identifier;
|
||||
if (!esutils.code.isIdentifierStart(source.charCodeAt(index))) {
|
||||
return null;
|
||||
}
|
||||
identifier = advance();
|
||||
while (index < last && esutils.code.isIdentifierPart(source.charCodeAt(index))) {
|
||||
identifier += advance();
|
||||
}
|
||||
return identifier;
|
||||
}
|
||||
|
||||
function skipWhiteSpace(last) {
|
||||
while (index < last && (esutils.code.isWhiteSpace(source.charCodeAt(index)) || esutils.code.isLineTerminator(source.charCodeAt(index)))) {
|
||||
advance();
|
||||
}
|
||||
}
|
||||
|
||||
function parseName(last, allowBrackets, allowNestedParams) {
|
||||
var name = '', useBrackets;
|
||||
|
||||
skipWhiteSpace(last);
|
||||
|
||||
if (index >= last) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (allowBrackets && source.charCodeAt(index) === 0x5B /* '[' */) {
|
||||
useBrackets = true;
|
||||
name = advance();
|
||||
}
|
||||
|
||||
if (!esutils.code.isIdentifierStart(source.charCodeAt(index))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
name += scanIdentifier(last);
|
||||
|
||||
if (allowNestedParams) {
|
||||
if (source.charCodeAt(index) === 0x3A /* ':' */ && (
|
||||
name === 'module' ||
|
||||
name === 'external' ||
|
||||
name === 'event')) {
|
||||
name += advance();
|
||||
name += scanIdentifier(last);
|
||||
|
||||
}
|
||||
if(source.charCodeAt(index) === 0x5B /* '[' */ && source.charCodeAt(index + 1) === 0x5D /* ']' */){
|
||||
name += advance();
|
||||
name += advance();
|
||||
}
|
||||
while (source.charCodeAt(index) === 0x2E /* '.' */ ||
|
||||
source.charCodeAt(index) === 0x23 /* '#' */ ||
|
||||
source.charCodeAt(index) === 0x7E /* '~' */) {
|
||||
name += advance();
|
||||
name += scanIdentifier(last);
|
||||
}
|
||||
}
|
||||
|
||||
if (useBrackets) {
|
||||
|
||||
|
||||
// do we have a default value for this?
|
||||
if (source.charCodeAt(index) === 0x3D /* '=' */) {
|
||||
// consume the '='' symbol
|
||||
name += advance();
|
||||
var bracketDepth = 1;
|
||||
// scan in the default value
|
||||
while (index < last) {
|
||||
if (source.charCodeAt(index) === 0x5B /* '[' */) {
|
||||
bracketDepth++;
|
||||
} else if (source.charCodeAt(index) === 0x5D /* ']' */ &&
|
||||
--bracketDepth === 0) {
|
||||
break;
|
||||
}
|
||||
name += advance();
|
||||
}
|
||||
}
|
||||
|
||||
if (index >= last || source.charCodeAt(index) !== 0x5D /* ']' */) {
|
||||
// we never found a closing ']'
|
||||
return null;
|
||||
}
|
||||
|
||||
// collect the last ']'
|
||||
name += advance();
|
||||
}
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
function skipToTag() {
|
||||
while (index < length && source.charCodeAt(index) !== 0x40 /* '@' */) {
|
||||
advance();
|
||||
}
|
||||
if (index >= length) {
|
||||
return false;
|
||||
}
|
||||
utility.assert(source.charCodeAt(index) === 0x40 /* '@' */);
|
||||
return true;
|
||||
}
|
||||
|
||||
function TagParser(options, title) {
|
||||
this._options = options;
|
||||
this._title = title;
|
||||
this._tag = {
|
||||
title: title,
|
||||
description: null
|
||||
};
|
||||
if (this._options.lineNumbers) {
|
||||
this._tag.lineNumber = lineNumber;
|
||||
}
|
||||
this._last = 0;
|
||||
// space to save special information for title parsers.
|
||||
this._extra = { };
|
||||
}
|
||||
|
||||
// addError(err, ...)
|
||||
TagParser.prototype.addError = function addError(errorText) {
|
||||
var args = Array.prototype.slice.call(arguments, 1),
|
||||
msg = errorText.replace(
|
||||
/%(\d)/g,
|
||||
function (whole, index) {
|
||||
utility.assert(index < args.length, 'Message reference must be in range');
|
||||
return args[index];
|
||||
}
|
||||
);
|
||||
|
||||
if (!this._tag.errors) {
|
||||
this._tag.errors = [];
|
||||
}
|
||||
if (strict) {
|
||||
utility.throwError(msg);
|
||||
}
|
||||
this._tag.errors.push(msg);
|
||||
return recoverable;
|
||||
};
|
||||
|
||||
TagParser.prototype.parseType = function () {
|
||||
// type required titles
|
||||
if (isTypeParameterRequired(this._title)) {
|
||||
try {
|
||||
this._tag.type = parseType(this._title, this._last);
|
||||
if (!this._tag.type) {
|
||||
if (!isParamTitle(this._title) && !isReturnTitle(this._title)) {
|
||||
if (!this.addError('Missing or invalid tag type')) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
this._tag.type = null;
|
||||
if (!this.addError(error.message)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else if (isAllowedType(this._title)) {
|
||||
// optional types
|
||||
try {
|
||||
this._tag.type = parseType(this._title, this._last);
|
||||
} catch (e) {
|
||||
//For optional types, lets drop the thrown error when we hit the end of the file
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
TagParser.prototype._parseNamePath = function (optional) {
|
||||
var name;
|
||||
name = parseName(this._last, sloppy && isParamTitle(this._title), true);
|
||||
if (!name) {
|
||||
if (!optional) {
|
||||
if (!this.addError('Missing or invalid tag name')) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
this._tag.name = name;
|
||||
return true;
|
||||
};
|
||||
|
||||
TagParser.prototype.parseNamePath = function () {
|
||||
return this._parseNamePath(false);
|
||||
};
|
||||
|
||||
TagParser.prototype.parseNamePathOptional = function () {
|
||||
return this._parseNamePath(true);
|
||||
};
|
||||
|
||||
|
||||
TagParser.prototype.parseName = function () {
|
||||
var assign, name;
|
||||
|
||||
// param, property requires name
|
||||
if (isAllowedName(this._title)) {
|
||||
this._tag.name = parseName(this._last, sloppy && isParamTitle(this._title), isAllowedNested(this._title));
|
||||
if (!this._tag.name) {
|
||||
if (!isNameParameterRequired(this._title)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// it's possible the name has already been parsed but interpreted as a type
|
||||
// it's also possible this is a sloppy declaration, in which case it will be
|
||||
// fixed at the end
|
||||
if (isParamTitle(this._title) && this._tag.type && this._tag.type.name) {
|
||||
this._extra.name = this._tag.type;
|
||||
this._tag.name = this._tag.type.name;
|
||||
this._tag.type = null;
|
||||
} else {
|
||||
if (!this.addError('Missing or invalid tag name')) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
name = this._tag.name;
|
||||
if (name.charAt(0) === '[' && name.charAt(name.length - 1) === ']') {
|
||||
// extract the default value if there is one
|
||||
// example: @param {string} [somebody=John Doe] description
|
||||
assign = name.substring(1, name.length - 1).split('=');
|
||||
if (assign[1]) {
|
||||
this._tag['default'] = assign[1];
|
||||
}
|
||||
this._tag.name = assign[0];
|
||||
|
||||
// convert to an optional type
|
||||
if (this._tag.type && this._tag.type.type !== 'OptionalType') {
|
||||
this._tag.type = {
|
||||
type: 'OptionalType',
|
||||
expression: this._tag.type
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
TagParser.prototype.parseDescription = function parseDescription() {
|
||||
var description = trim(sliceSource(source, index, this._last));
|
||||
if (description) {
|
||||
if ((/^-\s+/).test(description)) {
|
||||
description = description.substring(2);
|
||||
}
|
||||
this._tag.description = description;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
TagParser.prototype.parseKind = function parseKind() {
|
||||
var kind, kinds;
|
||||
kinds = {
|
||||
'class': true,
|
||||
'constant': true,
|
||||
'event': true,
|
||||
'external': true,
|
||||
'file': true,
|
||||
'function': true,
|
||||
'member': true,
|
||||
'mixin': true,
|
||||
'module': true,
|
||||
'namespace': true,
|
||||
'typedef': true
|
||||
};
|
||||
kind = trim(sliceSource(source, index, this._last));
|
||||
this._tag.kind = kind;
|
||||
if (!hasOwnProperty(kinds, kind)) {
|
||||
if (!this.addError('Invalid kind name \'%0\'', kind)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
TagParser.prototype.parseAccess = function parseAccess() {
|
||||
var access;
|
||||
access = trim(sliceSource(source, index, this._last));
|
||||
this._tag.access = access;
|
||||
if (access !== 'private' && access !== 'protected' && access !== 'public') {
|
||||
if (!this.addError('Invalid access name \'%0\'', access)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
TagParser.prototype.parseVariation = function parseVariation() {
|
||||
var variation, text;
|
||||
text = trim(sliceSource(source, index, this._last));
|
||||
variation = parseFloat(text, 10);
|
||||
this._tag.variation = variation;
|
||||
if (isNaN(variation)) {
|
||||
if (!this.addError('Invalid variation \'%0\'', text)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
TagParser.prototype.ensureEnd = function () {
|
||||
var shouldBeEmpty = trim(sliceSource(source, index, this._last));
|
||||
if (shouldBeEmpty) {
|
||||
if (!this.addError('Unknown content \'%0\'', shouldBeEmpty)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
TagParser.prototype.epilogue = function epilogue() {
|
||||
var description;
|
||||
|
||||
description = this._tag.description;
|
||||
// un-fix potentially sloppy declaration
|
||||
if (isParamTitle(this._title) && !this._tag.type && description && description.charAt(0) === '[') {
|
||||
this._tag.type = this._extra.name;
|
||||
if (!this._tag.name) {
|
||||
this._tag.name = undefined;
|
||||
}
|
||||
|
||||
if (!sloppy) {
|
||||
if (!this.addError('Missing or invalid tag name')) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
};
|
||||
|
||||
Rules = {
|
||||
// http://usejsdoc.org/tags-access.html
|
||||
'access': ['parseAccess'],
|
||||
// http://usejsdoc.org/tags-alias.html
|
||||
'alias': ['parseNamePath', 'ensureEnd'],
|
||||
// http://usejsdoc.org/tags-augments.html
|
||||
'augments': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
|
||||
// http://usejsdoc.org/tags-constructor.html
|
||||
'constructor': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
|
||||
// Synonym: http://usejsdoc.org/tags-constructor.html
|
||||
'class': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
|
||||
// Synonym: http://usejsdoc.org/tags-extends.html
|
||||
'extends': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
|
||||
// http://usejsdoc.org/tags-deprecated.html
|
||||
'deprecated': ['parseDescription'],
|
||||
// http://usejsdoc.org/tags-global.html
|
||||
'global': ['ensureEnd'],
|
||||
// http://usejsdoc.org/tags-inner.html
|
||||
'inner': ['ensureEnd'],
|
||||
// http://usejsdoc.org/tags-instance.html
|
||||
'instance': ['ensureEnd'],
|
||||
// http://usejsdoc.org/tags-kind.html
|
||||
'kind': ['parseKind'],
|
||||
// http://usejsdoc.org/tags-mixes.html
|
||||
'mixes': ['parseNamePath', 'ensureEnd'],
|
||||
// http://usejsdoc.org/tags-mixin.html
|
||||
'mixin': ['parseNamePathOptional', 'ensureEnd'],
|
||||
// http://usejsdoc.org/tags-member.html
|
||||
'member': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
|
||||
// http://usejsdoc.org/tags-method.html
|
||||
'method': ['parseNamePathOptional', 'ensureEnd'],
|
||||
// http://usejsdoc.org/tags-module.html
|
||||
'module': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
|
||||
// Synonym: http://usejsdoc.org/tags-method.html
|
||||
'func': ['parseNamePathOptional', 'ensureEnd'],
|
||||
// Synonym: http://usejsdoc.org/tags-method.html
|
||||
'function': ['parseNamePathOptional', 'ensureEnd'],
|
||||
// Synonym: http://usejsdoc.org/tags-member.html
|
||||
'var': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
|
||||
// http://usejsdoc.org/tags-name.html
|
||||
'name': ['parseNamePath', 'ensureEnd'],
|
||||
// http://usejsdoc.org/tags-namespace.html
|
||||
'namespace': ['parseType', 'parseNamePathOptional', 'ensureEnd'],
|
||||
// http://usejsdoc.org/tags-private.html
|
||||
'private': ['parseType', 'parseDescription'],
|
||||
// http://usejsdoc.org/tags-protected.html
|
||||
'protected': ['parseType', 'parseDescription'],
|
||||
// http://usejsdoc.org/tags-public.html
|
||||
'public': ['parseType', 'parseDescription'],
|
||||
// http://usejsdoc.org/tags-readonly.html
|
||||
'readonly': ['ensureEnd'],
|
||||
// http://usejsdoc.org/tags-requires.html
|
||||
'requires': ['parseNamePath', 'ensureEnd'],
|
||||
// http://usejsdoc.org/tags-since.html
|
||||
'since': ['parseDescription'],
|
||||
// http://usejsdoc.org/tags-static.html
|
||||
'static': ['ensureEnd'],
|
||||
// http://usejsdoc.org/tags-summary.html
|
||||
'summary': ['parseDescription'],
|
||||
// http://usejsdoc.org/tags-this.html
|
||||
'this': ['parseNamePath', 'ensureEnd'],
|
||||
// http://usejsdoc.org/tags-todo.html
|
||||
'todo': ['parseDescription'],
|
||||
// http://usejsdoc.org/tags-typedef.html
|
||||
'typedef': ['parseType', 'parseNamePathOptional'],
|
||||
// http://usejsdoc.org/tags-variation.html
|
||||
'variation': ['parseVariation'],
|
||||
// http://usejsdoc.org/tags-version.html
|
||||
'version': ['parseDescription']
|
||||
};
|
||||
|
||||
TagParser.prototype.parse = function parse() {
|
||||
var i, iz, sequences, method;
|
||||
|
||||
// empty title
|
||||
if (!this._title) {
|
||||
if (!this.addError('Missing or invalid title')) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
// Seek to content last index.
|
||||
this._last = seekContent(this._title);
|
||||
|
||||
if (hasOwnProperty(Rules, this._title)) {
|
||||
sequences = Rules[this._title];
|
||||
} else {
|
||||
// default sequences
|
||||
sequences = ['parseType', 'parseName', 'parseDescription', 'epilogue'];
|
||||
}
|
||||
|
||||
for (i = 0, iz = sequences.length; i < iz; ++i) {
|
||||
method = sequences[i];
|
||||
if (!this[method]()) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return this._tag;
|
||||
};
|
||||
|
||||
function parseTag(options) {
|
||||
var title, parser, tag;
|
||||
|
||||
// skip to tag
|
||||
if (!skipToTag()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// scan title
|
||||
title = scanTitle();
|
||||
|
||||
// construct tag parser
|
||||
parser = new TagParser(options, title);
|
||||
tag = parser.parse();
|
||||
|
||||
// Seek global index to end of this tag.
|
||||
while (index < parser._last) {
|
||||
advance();
|
||||
}
|
||||
return tag;
|
||||
}
|
||||
|
||||
//
|
||||
// Parse JSDoc
|
||||
//
|
||||
|
||||
function scanJSDocDescription(preserveWhitespace) {
|
||||
var description = '', ch, atAllowed;
|
||||
|
||||
atAllowed = true;
|
||||
while (index < length) {
|
||||
ch = source.charCodeAt(index);
|
||||
|
||||
if (atAllowed && ch === 0x40 /* '@' */) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (esutils.code.isLineTerminator(ch)) {
|
||||
atAllowed = true;
|
||||
} else if (atAllowed && !esutils.code.isWhiteSpace(ch)) {
|
||||
atAllowed = false;
|
||||
}
|
||||
|
||||
description += advance();
|
||||
}
|
||||
|
||||
return preserveWhitespace ? description : trim(description);
|
||||
}
|
||||
|
||||
function parse(comment, options) {
|
||||
var tags = [], tag, description, interestingTags, i, iz;
|
||||
|
||||
if (options === undefined) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
if (typeof options.unwrap === 'boolean' && options.unwrap) {
|
||||
source = unwrapComment(comment);
|
||||
} else {
|
||||
source = comment;
|
||||
}
|
||||
|
||||
// array of relevant tags
|
||||
if (options.tags) {
|
||||
if (isArray(options.tags)) {
|
||||
interestingTags = { };
|
||||
for (i = 0, iz = options.tags.length; i < iz; i++) {
|
||||
if (typeof options.tags[i] === 'string') {
|
||||
interestingTags[options.tags[i]] = true;
|
||||
} else {
|
||||
utility.throwError('Invalid "tags" parameter: ' + options.tags);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
utility.throwError('Invalid "tags" parameter: ' + options.tags);
|
||||
}
|
||||
}
|
||||
|
||||
length = source.length;
|
||||
index = 0;
|
||||
lineNumber = 0;
|
||||
recoverable = options.recoverable;
|
||||
sloppy = options.sloppy;
|
||||
strict = options.strict;
|
||||
|
||||
description = scanJSDocDescription(options.preserveWhitespace);
|
||||
|
||||
while (true) {
|
||||
tag = parseTag(options);
|
||||
if (!tag) {
|
||||
break;
|
||||
}
|
||||
if (!interestingTags || interestingTags.hasOwnProperty(tag.title)) {
|
||||
tags.push(tag);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
description: description,
|
||||
tags: tags
|
||||
};
|
||||
}
|
||||
exports.parse = parse;
|
||||
}(jsdoc = {}));
|
||||
|
||||
exports.version = utility.VERSION;
|
||||
exports.parse = jsdoc.parse;
|
||||
exports.parseType = typed.parseType;
|
||||
exports.parseParamType = typed.parseParamType;
|
||||
exports.unwrapComment = unwrapComment;
|
||||
exports.Syntax = shallowCopy(typed.Syntax);
|
||||
exports.Error = utility.DoctrineError;
|
||||
exports.type = {
|
||||
Syntax: exports.Syntax,
|
||||
parseType: typed.parseType,
|
||||
parseParamType: typed.parseParamType,
|
||||
stringify: typed.stringify
|
||||
};
|
||||
}());
|
||||
/* vim: set sw=4 ts=4 et tw=80 : */
|
||||
1261
node_modules/doctrine/lib/typed.js
generated
vendored
1261
node_modules/doctrine/lib/typed.js
generated
vendored
File diff suppressed because it is too large
Load diff
54
node_modules/doctrine/lib/utility.js
generated
vendored
54
node_modules/doctrine/lib/utility.js
generated
vendored
|
|
@ -1,54 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2014 Yusuke Suzuki <utatane.tea@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var VERSION;
|
||||
|
||||
VERSION = require('../package.json').version;
|
||||
exports.VERSION = VERSION;
|
||||
|
||||
function DoctrineError(message) {
|
||||
this.name = 'DoctrineError';
|
||||
this.message = message;
|
||||
}
|
||||
DoctrineError.prototype = (function () {
|
||||
var Middle = function () { };
|
||||
Middle.prototype = Error.prototype;
|
||||
return new Middle();
|
||||
}());
|
||||
DoctrineError.prototype.constructor = DoctrineError;
|
||||
exports.DoctrineError = DoctrineError;
|
||||
|
||||
function throwError(message) {
|
||||
throw new DoctrineError(message);
|
||||
}
|
||||
exports.throwError = throwError;
|
||||
|
||||
exports.assert = require('assert');
|
||||
}());
|
||||
|
||||
/* vim: set sw=4 ts=4 et tw=80 : */
|
||||
19
node_modules/doctrine/node_modules/esutils/LICENSE.BSD
generated
vendored
19
node_modules/doctrine/node_modules/esutils/LICENSE.BSD
generated
vendored
|
|
@ -1,19 +0,0 @@
|
|||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
169
node_modules/doctrine/node_modules/esutils/README.md
generated
vendored
169
node_modules/doctrine/node_modules/esutils/README.md
generated
vendored
|
|
@ -1,169 +0,0 @@
|
|||
### esutils [](http://travis-ci.org/Constellation/esutils)
|
||||
esutils ([esutils](http://github.com/Constellation/esutils)) is
|
||||
utility box for ECMAScript language tools.
|
||||
|
||||
### API
|
||||
|
||||
### ast
|
||||
|
||||
#### ast.isExpression(node)
|
||||
|
||||
Returns true if `node` is an Expression as defined in ECMA262 edition 5.1 section
|
||||
[11](https://es5.github.io/#x11).
|
||||
|
||||
#### ast.isStatement(node)
|
||||
|
||||
Returns true if `node` is a Statement as defined in ECMA262 edition 5.1 section
|
||||
[12](https://es5.github.io/#x12).
|
||||
|
||||
#### ast.isIterationStatement(node)
|
||||
|
||||
Returns true if `node` is an IterationStatement as defined in ECMA262 edition
|
||||
5.1 section [12.6](https://es5.github.io/#x12.6).
|
||||
|
||||
#### ast.isSourceElement(node)
|
||||
|
||||
Returns true if `node` is a SourceElement as defined in ECMA262 edition 5.1
|
||||
section [14](https://es5.github.io/#x14).
|
||||
|
||||
#### ast.trailingStatement(node)
|
||||
|
||||
Returns `Statement?` if `node` has trailing `Statement`.
|
||||
```js
|
||||
if (cond)
|
||||
consequent;
|
||||
```
|
||||
When taking this `IfStatement`, returns `consequent;` statement.
|
||||
|
||||
#### ast.isProblematicIfStatement(node)
|
||||
|
||||
Returns true if `node` is a problematic IfStatement. If `node` is a problematic `IfStatement`, `node` cannot be represented as an one on one JavaScript code.
|
||||
```js
|
||||
{
|
||||
type: 'IfStatement',
|
||||
consequent: {
|
||||
type: 'WithStatement',
|
||||
body: {
|
||||
type: 'IfStatement',
|
||||
consequent: {type: 'EmptyStatement'}
|
||||
}
|
||||
},
|
||||
alternate: {type: 'EmptyStatement'}
|
||||
}
|
||||
```
|
||||
The above node cannot be represented as a JavaScript code, since the top level `else` alternate belongs to an inner `IfStatement`.
|
||||
|
||||
|
||||
### code
|
||||
|
||||
#### code.isDecimalDigit(code)
|
||||
|
||||
Return true if provided code is decimal digit.
|
||||
|
||||
#### code.isHexDigit(code)
|
||||
|
||||
Return true if provided code is hexadecimal digit.
|
||||
|
||||
#### code.isOctalDigit(code)
|
||||
|
||||
Return true if provided code is octal digit.
|
||||
|
||||
#### code.isWhiteSpace(code)
|
||||
|
||||
Return true if provided code is white space. White space characters are formally defined in ECMA262.
|
||||
|
||||
#### code.isLineTerminator(code)
|
||||
|
||||
Return true if provided code is line terminator. Line terminator characters are formally defined in ECMA262.
|
||||
|
||||
#### code.isIdentifierStart(code)
|
||||
|
||||
Return true if provided code can be the first character of ECMA262 Identifier. They are formally defined in ECMA262.
|
||||
|
||||
#### code.isIdentifierPart(code)
|
||||
|
||||
Return true if provided code can be the trailing character of ECMA262 Identifier. They are formally defined in ECMA262.
|
||||
|
||||
### keyword
|
||||
|
||||
#### keyword.isKeywordES5(id, strict)
|
||||
|
||||
Returns `true` if provided identifier string is a Keyword or Future Reserved Word
|
||||
in ECMA262 edition 5.1. They are formally defined in ECMA262 sections
|
||||
[7.6.1.1](http://es5.github.io/#x7.6.1.1) and [7.6.1.2](http://es5.github.io/#x7.6.1.2),
|
||||
respectively. If the `strict` flag is truthy, this function additionally checks whether
|
||||
`id` is a Keyword or Future Reserved Word under strict mode.
|
||||
|
||||
#### keyword.isKeywordES6(id, strict)
|
||||
|
||||
Returns `true` if provided identifier string is a Keyword or Future Reserved Word
|
||||
in ECMA262 edition 6. They are formally defined in ECMA262 sections
|
||||
[11.6.2.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-keywords) and
|
||||
[11.6.2.2](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-future-reserved-words),
|
||||
respectively. If the `strict` flag is truthy, this function additionally checks whether
|
||||
`id` is a Keyword or Future Reserved Word under strict mode.
|
||||
|
||||
#### keyword.isReservedWordES5(id, strict)
|
||||
|
||||
Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 5.1.
|
||||
They are formally defined in ECMA262 section [7.6.1](http://es5.github.io/#x7.6.1).
|
||||
If the `strict` flag is truthy, this function additionally checks whether `id`
|
||||
is a Reserved Word under strict mode.
|
||||
|
||||
#### keyword.isReservedWordES6(id, strict)
|
||||
|
||||
Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 6.
|
||||
They are formally defined in ECMA262 section [11.6.2](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-reserved-words).
|
||||
If the `strict` flag is truthy, this function additionally checks whether `id`
|
||||
is a Reserved Word under strict mode.
|
||||
|
||||
#### keyword.isRestrictedWord(id)
|
||||
|
||||
Returns `true` if provided identifier string is one of `eval` or `arguments`.
|
||||
They are restricted in strict mode code throughout ECMA262 edition 5.1 and
|
||||
in ECMA262 edition 6 section [12.1.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-identifiers-static-semantics-early-errors).
|
||||
|
||||
#### keyword.isIdentifierName(id)
|
||||
|
||||
Return true if provided identifier string is an IdentifierName as specified in
|
||||
ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6).
|
||||
|
||||
#### keyword.isIdentifierES5(id, strict)
|
||||
|
||||
Return true if provided identifier string is an Identifier as specified in
|
||||
ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). If the `strict`
|
||||
flag is truthy, this function additionally checks whether `id` is an Identifier
|
||||
under strict mode.
|
||||
|
||||
#### keyword.isIdentifierES6(id, strict)
|
||||
|
||||
Return true if provided identifier string is an Identifier as specified in
|
||||
ECMA262 edition 6 section [12.1](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-identifiers).
|
||||
If the `strict` flag is truthy, this function additionally checks whether `id`
|
||||
is an Identifier under strict mode.
|
||||
|
||||
### License
|
||||
|
||||
Copyright (C) 2013 [Yusuke Suzuki](http://github.com/Constellation)
|
||||
(twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
144
node_modules/doctrine/node_modules/esutils/lib/ast.js
generated
vendored
144
node_modules/doctrine/node_modules/esutils/lib/ast.js
generated
vendored
|
|
@ -1,144 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
function isExpression(node) {
|
||||
if (node == null) { return false; }
|
||||
switch (node.type) {
|
||||
case 'ArrayExpression':
|
||||
case 'AssignmentExpression':
|
||||
case 'BinaryExpression':
|
||||
case 'CallExpression':
|
||||
case 'ConditionalExpression':
|
||||
case 'FunctionExpression':
|
||||
case 'Identifier':
|
||||
case 'Literal':
|
||||
case 'LogicalExpression':
|
||||
case 'MemberExpression':
|
||||
case 'NewExpression':
|
||||
case 'ObjectExpression':
|
||||
case 'SequenceExpression':
|
||||
case 'ThisExpression':
|
||||
case 'UnaryExpression':
|
||||
case 'UpdateExpression':
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isIterationStatement(node) {
|
||||
if (node == null) { return false; }
|
||||
switch (node.type) {
|
||||
case 'DoWhileStatement':
|
||||
case 'ForInStatement':
|
||||
case 'ForStatement':
|
||||
case 'WhileStatement':
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isStatement(node) {
|
||||
if (node == null) { return false; }
|
||||
switch (node.type) {
|
||||
case 'BlockStatement':
|
||||
case 'BreakStatement':
|
||||
case 'ContinueStatement':
|
||||
case 'DebuggerStatement':
|
||||
case 'DoWhileStatement':
|
||||
case 'EmptyStatement':
|
||||
case 'ExpressionStatement':
|
||||
case 'ForInStatement':
|
||||
case 'ForStatement':
|
||||
case 'IfStatement':
|
||||
case 'LabeledStatement':
|
||||
case 'ReturnStatement':
|
||||
case 'SwitchStatement':
|
||||
case 'ThrowStatement':
|
||||
case 'TryStatement':
|
||||
case 'VariableDeclaration':
|
||||
case 'WhileStatement':
|
||||
case 'WithStatement':
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function isSourceElement(node) {
|
||||
return isStatement(node) || node != null && node.type === 'FunctionDeclaration';
|
||||
}
|
||||
|
||||
function trailingStatement(node) {
|
||||
switch (node.type) {
|
||||
case 'IfStatement':
|
||||
if (node.alternate != null) {
|
||||
return node.alternate;
|
||||
}
|
||||
return node.consequent;
|
||||
|
||||
case 'LabeledStatement':
|
||||
case 'ForStatement':
|
||||
case 'ForInStatement':
|
||||
case 'WhileStatement':
|
||||
case 'WithStatement':
|
||||
return node.body;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function isProblematicIfStatement(node) {
|
||||
var current;
|
||||
|
||||
if (node.type !== 'IfStatement') {
|
||||
return false;
|
||||
}
|
||||
if (node.alternate == null) {
|
||||
return false;
|
||||
}
|
||||
current = node.consequent;
|
||||
do {
|
||||
if (current.type === 'IfStatement') {
|
||||
if (current.alternate == null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
current = trailingStatement(current);
|
||||
} while (current);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isExpression: isExpression,
|
||||
isStatement: isStatement,
|
||||
isIterationStatement: isIterationStatement,
|
||||
isSourceElement: isSourceElement,
|
||||
isProblematicIfStatement: isProblematicIfStatement,
|
||||
|
||||
trailingStatement: trailingStatement
|
||||
};
|
||||
}());
|
||||
/* vim: set sw=4 ts=4 et tw=80 : */
|
||||
101
node_modules/doctrine/node_modules/esutils/lib/code.js
generated
vendored
101
node_modules/doctrine/node_modules/esutils/lib/code.js
generated
vendored
File diff suppressed because one or more lines are too long
137
node_modules/doctrine/node_modules/esutils/lib/keyword.js
generated
vendored
137
node_modules/doctrine/node_modules/esutils/lib/keyword.js
generated
vendored
|
|
@ -1,137 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
var code = require('./code');
|
||||
|
||||
function isStrictModeReservedWordES6(id) {
|
||||
switch (id) {
|
||||
case 'implements':
|
||||
case 'interface':
|
||||
case 'package':
|
||||
case 'private':
|
||||
case 'protected':
|
||||
case 'public':
|
||||
case 'static':
|
||||
case 'let':
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isKeywordES5(id, strict) {
|
||||
// yield should not be treated as keyword under non-strict mode.
|
||||
if (!strict && id === 'yield') {
|
||||
return false;
|
||||
}
|
||||
return isKeywordES6(id, strict);
|
||||
}
|
||||
|
||||
function isKeywordES6(id, strict) {
|
||||
if (strict && isStrictModeReservedWordES6(id)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
switch (id.length) {
|
||||
case 2:
|
||||
return (id === 'if') || (id === 'in') || (id === 'do');
|
||||
case 3:
|
||||
return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try');
|
||||
case 4:
|
||||
return (id === 'this') || (id === 'else') || (id === 'case') ||
|
||||
(id === 'void') || (id === 'with') || (id === 'enum');
|
||||
case 5:
|
||||
return (id === 'while') || (id === 'break') || (id === 'catch') ||
|
||||
(id === 'throw') || (id === 'const') || (id === 'yield') ||
|
||||
(id === 'class') || (id === 'super');
|
||||
case 6:
|
||||
return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
|
||||
(id === 'switch') || (id === 'export') || (id === 'import');
|
||||
case 7:
|
||||
return (id === 'default') || (id === 'finally') || (id === 'extends');
|
||||
case 8:
|
||||
return (id === 'function') || (id === 'continue') || (id === 'debugger');
|
||||
case 10:
|
||||
return (id === 'instanceof');
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
function isReservedWordES5(id, strict) {
|
||||
return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict);
|
||||
}
|
||||
|
||||
function isReservedWordES6(id, strict) {
|
||||
return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict);
|
||||
}
|
||||
|
||||
function isRestrictedWord(id) {
|
||||
return id === 'eval' || id === 'arguments';
|
||||
}
|
||||
|
||||
function isIdentifierName(id) {
|
||||
var i, iz, ch;
|
||||
|
||||
if (id.length === 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ch = id.charCodeAt(0);
|
||||
if (!code.isIdentifierStart(ch) || ch === 92) { // \ (backslash)
|
||||
return false;
|
||||
}
|
||||
|
||||
for (i = 1, iz = id.length; i < iz; ++i) {
|
||||
ch = id.charCodeAt(i);
|
||||
if (!code.isIdentifierPart(ch) || ch === 92) { // \ (backslash)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function isIdentifierES5(id, strict) {
|
||||
return isIdentifierName(id) && !isReservedWordES5(id, strict);
|
||||
}
|
||||
|
||||
function isIdentifierES6(id, strict) {
|
||||
return isIdentifierName(id) && !isReservedWordES6(id, strict);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
isKeywordES5: isKeywordES5,
|
||||
isKeywordES6: isKeywordES6,
|
||||
isReservedWordES5: isReservedWordES5,
|
||||
isReservedWordES6: isReservedWordES6,
|
||||
isRestrictedWord: isRestrictedWord,
|
||||
isIdentifierName: isIdentifierName,
|
||||
isIdentifierES5: isIdentifierES5,
|
||||
isIdentifierES6: isIdentifierES6
|
||||
};
|
||||
}());
|
||||
/* vim: set sw=4 ts=4 et tw=80 : */
|
||||
33
node_modules/doctrine/node_modules/esutils/lib/utils.js
generated
vendored
33
node_modules/doctrine/node_modules/esutils/lib/utils.js
generated
vendored
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
* Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
* Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
||||
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
||||
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
exports.ast = require('./ast');
|
||||
exports.code = require('./code');
|
||||
exports.keyword = require('./keyword');
|
||||
}());
|
||||
/* vim: set sw=4 ts=4 et tw=80 : */
|
||||
49
node_modules/doctrine/node_modules/esutils/package.json
generated
vendored
49
node_modules/doctrine/node_modules/esutils/package.json
generated
vendored
|
|
@ -1,49 +0,0 @@
|
|||
{
|
||||
"name": "esutils",
|
||||
"description": "utility box for ECMAScript language tools",
|
||||
"homepage": "https://github.com/Constellation/esutils",
|
||||
"main": "lib/utils.js",
|
||||
"version": "1.1.6",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "./lib"
|
||||
},
|
||||
"files": [
|
||||
"LICENSE.BSD",
|
||||
"README.md",
|
||||
"lib"
|
||||
],
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Yusuke Suzuki",
|
||||
"email": "utatane.tea@gmail.com",
|
||||
"web": "http://github.com/Constellation"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/Constellation/esutils.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"mocha": "~1.12.0",
|
||||
"chai": "~1.7.2",
|
||||
"jshint": "2.1.5",
|
||||
"coffee-script": "~1.6.3",
|
||||
"unicode-6.3.0": "~0.1.1",
|
||||
"regenerate": "~0.5.4"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "BSD",
|
||||
"url": "http://github.com/Constellation/esutils/raw/master/LICENSE.BSD"
|
||||
}
|
||||
],
|
||||
"scripts": {
|
||||
"test": "npm run-script lint && npm run-script unit-test",
|
||||
"lint": "jshint lib/*.js",
|
||||
"unit-test": "mocha --compilers coffee:coffee-script -R spec",
|
||||
"generate-regex": "node tools/generate-identifier-regex.js"
|
||||
}
|
||||
}
|
||||
69
node_modules/doctrine/package.json
generated
vendored
69
node_modules/doctrine/package.json
generated
vendored
|
|
@ -1,69 +0,0 @@
|
|||
{
|
||||
"name": "doctrine",
|
||||
"description": "JSDoc parser",
|
||||
"homepage": "https://github.com/eslint/doctrine",
|
||||
"main": "lib/doctrine.js",
|
||||
"version": "0.7.2",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "./lib"
|
||||
},
|
||||
"files": [
|
||||
"lib",
|
||||
"LICENSE.BSD",
|
||||
"LICENSE.closure-compiler",
|
||||
"LICENSE.esprima",
|
||||
"README.md"
|
||||
],
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "Yusuke Suzuki",
|
||||
"email": "utatane.tea@gmail.com",
|
||||
"web": "http://github.com/Constellation"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "http://github.com/eslint/doctrine.git"
|
||||
},
|
||||
"devDependencies": {
|
||||
"coveralls": "^2.11.2",
|
||||
"dateformat": "^1.0.11",
|
||||
"eslint": "^1.9.0",
|
||||
"gulp": "^3.8.10",
|
||||
"gulp-bump": "^0.1.13",
|
||||
"gulp-eslint": "^0.5.0",
|
||||
"gulp-filter": "^2.0.2",
|
||||
"gulp-git": "^1.0.0",
|
||||
"gulp-istanbul": "^0.6.0",
|
||||
"gulp-jshint": "^1.9.0",
|
||||
"gulp-mocha": "^2.0.0",
|
||||
"gulp-tag-version": "^1.2.1",
|
||||
"jshint-stylish": "^1.0.0",
|
||||
"linefix": "^0.1.1",
|
||||
"mocha": "^2.3.3",
|
||||
"npm-license": "^0.3.1",
|
||||
"semver": "^5.0.3",
|
||||
"shelljs": "^0.5.3",
|
||||
"shelljs-nodecli": "^0.1.1",
|
||||
"should": "^5.0.1"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "BSD",
|
||||
"url": "http://github.com/eslint/doctrine/raw/master/LICENSE.BSD"
|
||||
}
|
||||
],
|
||||
"scripts": {
|
||||
"test": "gulp",
|
||||
"unit-test": "gulp test",
|
||||
"lint": "gulp lint",
|
||||
"coveralls": "cat ./coverage/lcov.info | coveralls && rm -rf ./coverage"
|
||||
},
|
||||
"dependencies": {
|
||||
"esutils": "^1.1.6",
|
||||
"isarray": "0.0.1"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue