Initial
This commit is contained in:
34
resources/app/node_modules/intl-messageformat-parser/LICENSE
generated
vendored
Normal file
34
resources/app/node_modules/intl-messageformat-parser/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
Copyright 2014 Yahoo! Inc.
|
||||
All rights reserved.
|
||||
|
||||
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.
|
||||
|
||||
* Neither the name of the Yahoo! Inc. nor the
|
||||
names of its contributors may be used to endorse or promote products
|
||||
derived from this software without specific prior written permission.
|
||||
|
||||
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 YAHOO! INC. 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.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Inspired by and derived from:
|
||||
messageformat.js https://github.com/SlexAxton/messageformat.js
|
||||
Copyright 2014 Alex Sexton
|
||||
Apache License, Version 2.0
|
||||
1345
resources/app/node_modules/intl-messageformat-parser/dist/parser.js
generated
vendored
Normal file
1345
resources/app/node_modules/intl-messageformat-parser/dist/parser.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
resources/app/node_modules/intl-messageformat-parser/dist/parser.js.map
generated
vendored
Normal file
1
resources/app/node_modules/intl-messageformat-parser/dist/parser.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
4
resources/app/node_modules/intl-messageformat-parser/index.js
generated
vendored
Normal file
4
resources/app/node_modules/intl-messageformat-parser/index.js
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
'use strict';
|
||||
|
||||
exports = module.exports = require('./lib/parser')['default'];
|
||||
exports['default'] = exports;
|
||||
1341
resources/app/node_modules/intl-messageformat-parser/lib/parser.js
generated
vendored
Normal file
1341
resources/app/node_modules/intl-messageformat-parser/lib/parser.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
27
resources/app/node_modules/intl-messageformat-parser/package.json
generated
vendored
Normal file
27
resources/app/node_modules/intl-messageformat-parser/package.json
generated
vendored
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "intl-messageformat-parser",
|
||||
"version": "1.1.0",
|
||||
"description": "Parses ICU Message strings into an AST via JavaScript.",
|
||||
"main": "index.js",
|
||||
"jsnext:main": "src/parser.js",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/yahoo/intl-messageformat-parser.git"
|
||||
},
|
||||
"author": "Eric Ferraiuolo <eferraiuolo@gmail.com>",
|
||||
"license": "BSD",
|
||||
"homepage": "https://github.com/yahoo/intl-messageformat-parser",
|
||||
"devDependencies": {
|
||||
"expect.js": "^0.3.1",
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-benchmark": "^0.3.0",
|
||||
"grunt-bundle-jsnext-lib": "^0.5.0",
|
||||
"grunt-cli": "^0.1.13",
|
||||
"grunt-contrib-clean": "^0.6.0",
|
||||
"grunt-contrib-copy": "^0.7.0",
|
||||
"grunt-peg": "^1.5.0",
|
||||
"istanbul": "^0.3.2",
|
||||
"mocha": "^2.0.1",
|
||||
"xunit-file": "0.0.6"
|
||||
}
|
||||
}
|
||||
1337
resources/app/node_modules/intl-messageformat-parser/src/parser.js
generated
vendored
Normal file
1337
resources/app/node_modules/intl-messageformat-parser/src/parser.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
157
resources/app/node_modules/intl-messageformat-parser/src/parser.pegjs
generated
vendored
Normal file
157
resources/app/node_modules/intl-messageformat-parser/src/parser.pegjs
generated
vendored
Normal file
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
Copyright 2014, Yahoo! Inc. All rights reserved.
|
||||
Copyrights licensed under the New BSD License.
|
||||
See the accompanying LICENSE file for terms.
|
||||
*/
|
||||
|
||||
/*
|
||||
Inspired by and derivied from:
|
||||
messageformat.js https://github.com/SlexAxton/messageformat.js
|
||||
Copyright 2014 Alex Sexton
|
||||
Apache License, Version 2.0
|
||||
*/
|
||||
|
||||
start
|
||||
= messageFormatPattern
|
||||
|
||||
messageFormatPattern
|
||||
= elements:messageFormatElement* {
|
||||
return {
|
||||
type : 'messageFormatPattern',
|
||||
elements: elements
|
||||
};
|
||||
}
|
||||
|
||||
messageFormatElement
|
||||
= messageTextElement
|
||||
/ argumentElement
|
||||
|
||||
messageText
|
||||
= text:(_ chars _)+ {
|
||||
var string = '',
|
||||
i, j, outerLen, inner, innerLen;
|
||||
|
||||
for (i = 0, outerLen = text.length; i < outerLen; i += 1) {
|
||||
inner = text[i];
|
||||
|
||||
for (j = 0, innerLen = inner.length; j < innerLen; j += 1) {
|
||||
string += inner[j];
|
||||
}
|
||||
}
|
||||
|
||||
return string;
|
||||
}
|
||||
/ $(ws)
|
||||
|
||||
messageTextElement
|
||||
= messageText:messageText {
|
||||
return {
|
||||
type : 'messageTextElement',
|
||||
value: messageText
|
||||
};
|
||||
}
|
||||
|
||||
argument
|
||||
= number
|
||||
/ $([^ \t\n\r,.+={}#]+)
|
||||
|
||||
argumentElement
|
||||
= '{' _ id:argument _ format:(',' _ elementFormat)? _ '}' {
|
||||
return {
|
||||
type : 'argumentElement',
|
||||
id : id,
|
||||
format: format && format[2]
|
||||
};
|
||||
}
|
||||
|
||||
elementFormat
|
||||
= simpleFormat
|
||||
/ pluralFormat
|
||||
/ selectOrdinalFormat
|
||||
/ selectFormat
|
||||
|
||||
simpleFormat
|
||||
= type:('number' / 'date' / 'time') _ style:(',' _ chars)? {
|
||||
return {
|
||||
type : type + 'Format',
|
||||
style: style && style[2]
|
||||
};
|
||||
}
|
||||
|
||||
pluralFormat
|
||||
= 'plural' _ ',' _ pluralStyle:pluralStyle {
|
||||
return {
|
||||
type : pluralStyle.type,
|
||||
ordinal: false,
|
||||
offset : pluralStyle.offset || 0,
|
||||
options: pluralStyle.options
|
||||
};
|
||||
}
|
||||
|
||||
selectOrdinalFormat
|
||||
= 'selectordinal' _ ',' _ pluralStyle:pluralStyle {
|
||||
return {
|
||||
type : pluralStyle.type,
|
||||
ordinal: true,
|
||||
offset : pluralStyle.offset || 0,
|
||||
options: pluralStyle.options
|
||||
}
|
||||
}
|
||||
|
||||
selectFormat
|
||||
= 'select' _ ',' _ options:optionalFormatPattern+ {
|
||||
return {
|
||||
type : 'selectFormat',
|
||||
options: options
|
||||
};
|
||||
}
|
||||
|
||||
selector
|
||||
= $('=' number)
|
||||
/ chars
|
||||
|
||||
optionalFormatPattern
|
||||
= _ selector:selector _ '{' _ pattern:messageFormatPattern _ '}' {
|
||||
return {
|
||||
type : 'optionalFormatPattern',
|
||||
selector: selector,
|
||||
value : pattern
|
||||
};
|
||||
}
|
||||
|
||||
offset
|
||||
= 'offset:' _ number:number {
|
||||
return number;
|
||||
}
|
||||
|
||||
pluralStyle
|
||||
= offset:offset? _ options:optionalFormatPattern+ {
|
||||
return {
|
||||
type : 'pluralFormat',
|
||||
offset : offset,
|
||||
options: options
|
||||
};
|
||||
}
|
||||
|
||||
// -- Helpers ------------------------------------------------------------------
|
||||
|
||||
ws 'whitespace' = [ \t\n\r]+
|
||||
_ 'optionalWhitespace' = $(ws*)
|
||||
|
||||
digit = [0-9]
|
||||
hexDigit = [0-9a-f]i
|
||||
|
||||
number = digits:('0' / $([1-9] digit*)) {
|
||||
return parseInt(digits, 10);
|
||||
}
|
||||
|
||||
char
|
||||
= [^{}\\\0-\x1F\x7f \t\n\r]
|
||||
/ '\\#' { return '\\#'; }
|
||||
/ '\\{' { return '\u007B'; }
|
||||
/ '\\}' { return '\u007D'; }
|
||||
/ '\\u' digits:$(hexDigit hexDigit hexDigit hexDigit) {
|
||||
return String.fromCharCode(parseInt(digits, 16));
|
||||
}
|
||||
|
||||
chars = chars:char+ { return chars.join(''); }
|
||||
Reference in New Issue
Block a user