Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(201)

Side by Side Diff: polymer_0.5.4/bower_components/context-free-parser/context-free-parser.js

Issue 895523005: Added Polymer 0.5.4 (Closed) Base URL: https://chromium.googlesource.com/infra/third_party/npm_modules.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /**
2 * @license 2 * @license
3 * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 3 * Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
4 * This code may only be used under the BSD style license found at http://polyme r.github.io/LICENSE.txt 4 * This code may only be used under the BSD style license found at http://polyme r.github.io/LICENSE.txt
5 * The complete set of authors may be found at http://polymer.github.io/AUTHORS. txt 5 * The complete set of authors may be found at http://polymer.github.io/AUTHORS. txt
6 * The complete set of contributors may be found at http://polymer.github.io/CON TRIBUTORS.txt 6 * The complete set of contributors may be found at http://polymer.github.io/CON TRIBUTORS.txt
7 * Code distributed by Google as part of the polymer project is also 7 * Code distributed by Google as part of the polymer project is also
8 * subject to an additional IP rights grant found at http://polymer.github.io/PA TENTS.txt 8 * subject to an additional IP rights grant found at http://polymer.github.io/PA TENTS.txt
9 */ 9 */
10 10
11 (function(scope) { 11 (function(scope) {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 53
54 // currently all entities are either @class or @element 54 // currently all entities are either @class or @element
55 case 'class': 55 case 'class':
56 case 'element': 56 case 'element':
57 current = { 57 current = {
58 name: content, 58 name: content,
59 description: code 59 description: code
60 }; 60 };
61 entities.push(current); 61 entities.push(current);
62 break; 62 break;
63 63
64 // an entity may have these describable sub-features 64 // an entity may have these describable sub-features
65 case 'attribute': 65 case 'attribute':
66 case 'property': 66 case 'property':
67 case 'method': 67 case 'method':
68 case 'event': 68 case 'event':
69 subCurrent = { 69 subCurrent = {
70 name: content, 70 name: content,
71 description: code 71 description: code
72 }; 72 };
73 var label = pragma == 'property' ? 'properties' : pragma + 's'; 73 var label = pragma == 'property' ? 'properties' : pragma + 's';
(...skipping 13 matching lines...) Expand all
87 if (params) { 87 if (params) {
88 var subEventObj = { 88 var subEventObj = {
89 type: params[1], 89 type: params[1],
90 name: params[2], 90 name: params[2],
91 description: params[3] 91 description: params[3]
92 }; 92 };
93 makePragma(subCurrent, pragma + 's', subEventObj); 93 makePragma(subCurrent, pragma + 's', subEventObj);
94 } 94 }
95 95
96 break; 96 break;
97 97
98 case 'extends':
99 case 'mixins':
100 var parts = content.split(' ');
101 var subObj = {
102 name: parts[0],
103 url: parts[1] || null
104 };
105 makePragma(current, pragma, subObj);
106 break;
107
98 // everything else 108 // everything else
99 default: 109 default:
100 current[pragma] = content; 110 current[pragma] = content;
101 break; 111 break;
102 } 112 }
103 }); 113 });
104 114
105 // utility function, yay hoisting 115 // utility function, yay hoisting
106 function makePragma(object, pragma, content) { 116 function makePragma(object, pragma, content) {
107 var p$ = object; 117 var p$ = object;
(...skipping 12 matching lines...) Expand all
120 return entities; 130 return entities;
121 } 131 }
122 }; 132 };
123 133
124 if (typeof module !== 'undefined' && module.exports) { 134 if (typeof module !== 'undefined' && module.exports) {
125 module.exports = ContextFreeParser; 135 module.exports = ContextFreeParser;
126 } else { 136 } else {
127 scope.ContextFreeParser = ContextFreeParser; 137 scope.ContextFreeParser = ContextFreeParser;
128 } 138 }
129 139
130 })(this); 140 })(this);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698