拍 拍 网 怎 么 申 请 退 款&infinidock设置;拍 拍 网 能 退 款 吗→√

处理 SSI 文件时出错
您的位置: &
欢迎光临阿里西西网页脚本特效中心,点击运行按钮演示特效: 以下是程序代码
有什么问题请到&a href='/bbs/index.asp?boardid=2'&论坛&/a&中发表&br&
&!-- /js --&
&!-- bbs /bbs--&
&!-- 完整的HTML代码 --&
如何在网页中显示特殊字符
td{font-size:9color:}
&table align=center border=0 cellpacing=0 cellpadding=2 bgcolor=#dadada width=400&
&tr&&td colspan=3&&font color=red&注意:使用时已命名实体前均需加&符号,十进制编码前均需加&#符号&/font&&/td&&/tr&
&tr&&td&Character&br& 字符&/td&&td&Named entity&br& 已命名实体&/td&&td&Numeric character reference &br&十进制编码&/td&&/tr&
&tr&&td colspan=3 bgcolor=aaaa&&font color=yellow&扩展拉丁字符 Latin Extended-B&/font&&/td&&/tr&
&tr&&td&ƒ&/td&&td&&/td&&td&402;&/td&&/tr&
&tr&&td colspan=3 bgcolor=aaaa&&font color=yellow&希腊字符 Greek&/font&&/td&&/tr&
&tr&&td&Α&/td&&td&A&/td&&td&913;&/td&&/tr&
&tr&&td&Β&/td&&td&B&/td&&td&914;&/td&&/tr&
&tr&&td&Γ&/td&&td&G&/td&&td&915;&/td&&/tr&
&tr&&td&Δ&/td&&td&D&/td&&td&916;&/td&&/tr&
&tr&&td&Ε&/td&&td&E&/td&&td&917;&/td&&/tr&
&tr&&td&Ζ&/td&&td&Z&/td&&td&918;&/td&&/tr&
&tr&&td&Η&/td&&td&E&/td&&td&919;&/td&&/tr&
&tr&&td&Θ&/td&&td&T&/td&&td&920;&/td&&/tr&
&tr&&td&Ι&/td&&td&I&/td&&td&921;&/td&&/tr&
&tr&&td&Κ&/td&&td&K&/td&&td&922;&/td&&/tr&
&tr&&td&Λ&/td&&td&L&/td&&td&923;&/td&&/tr&
&tr&&td&Μ&/td&&tdΜ&/td&&td&924;&/td&&/tr&
&tr&&td&Ν&/td&&tdΝ&/td&&td&925;&/td&&/tr&
&tr&&td&Ξ&/td&&tdΞ&/td&&td&926;&/td&&/tr&
&tr&&td&Ο&/td&&td&O&/td&&td&927;&/td&&/tr&
&tr&&td&Π&/td&&tdΠ&/td&&td&928;&/td&&/tr&
&tr&&td&Ρ&/td&&td&R&/td&&td&929;&/td&&/tr&
&tr&&td&Σ&/td&&td&S&/td&&td&931;&/td&&/tr&
&tr&&td&Τ&/td&&td&T&/td&&td&932;&/td&&/tr&
&tr&&td&Υ&/td&&td&U&/td&&td&933;&/td&&/tr&
&tr&&td&Φ&/td&&td&P&/td&&td&934;&/td&&/tr&
&tr&&td&Χ&/td&&td&C&/td&&td&935;&/td&&/tr&
&tr&&td&Ψ&/td&&td&P&/td&&td&936;&/td&&/tr&
&tr&&td&Ω&/td&&td&O&/td&&td&937;&/td&&/tr&
&tr&&td&α&/td&&td&&/td&&td&945;&/td&&/tr&
&tr&&td&β&/td&&td&&/td&&td&946;&/td&&/tr&
&tr&&td&γ&/td&&td&&/td&&td&947;&/td&&/tr&
&tr&&td&δ&/td&&td&&/td&&td&948;&/td&&/tr&
&tr&&td&ε&/td&&td&&/td&&td&949;&/td&&/tr&
&tr&&td&ζ&/td&&td&&/td&&td&950;&/td&&/tr&
&tr&&td&η&/td&&td&&/td&&td&951;&/td&&/tr&
&tr&&td&θ&/td&&td&&/td&&td&952;&/td&&/tr&
&tr&&td&ι&/td&&td&&/td&&td&953;&/td&&/tr&
&tr&&td&κ&/td&&td&&/td&&td&954;&/td&&/tr&
&tr&&td&λ&/td&&td&&/td&&td&955;&/td&&/tr&
&tr&&td&μ&/td&&td&&/td&&td&956;&/td&&/tr&
&tr&&td&ν&/td&&td&&/td&&td&957;&/td&&/tr&
&tr&&td&ξ&/td&&td&&/td&&td&958;&/td&&/tr&
&tr&&td&ο&/td&&td&&/td&&td&959;&/td&&/tr&
&tr&&td&π&/td&&td&&/td&&td&960;&/td&&/tr&
&tr&&td&ρ&/td&&td&&/td&&td&961;&/td&&/tr&
&tr&&td&ς&/td&&td&&/td&&td&962;&/td&&/tr&
&tr&&td&σ&/td&&td&&/td&&td&963;&/td&&/tr&
&tr&&td&τ&/td&&td&&/td&&td&964;&/td&&/tr&
&tr&&td&υ&/td&&td&&/td&&td&965;&/td&&/tr&
&tr&&td&φ&/td&&td&&/td&&td&966;&/td&&/tr&
&tr&&td&χ&/td&&td&&/td&&td&967;&/td&&/tr&
&tr&&td&ψ&/td&&td&&/td&&td&968;&/td&&/tr&
&tr&&td&ω&/td&&td&&/td&&td&969;&/td&&/tr&
&tr&&td&ϑ&/td&&td&&/td&&td&977;&/td&&/tr&
&tr&&td&ϒ&/td&&td&&/td&&td&978;&/td&&/tr&
&tr&&td&ϖ&/td&&td&&/td&&td&982;&/td&&/tr&
&tr&&td colspan=3 bgcolor=aaaa&&font color=yellow&通用标点符号 General Punctuation&/font&&/td&&/tr&
威廉罗那 15:48:00
&tr&&td&•&/td&&td&&/td&&td&8226;&/td&&/tr&
&tr&&td&…&/td&&td&&/td&&td&8230;&/td&&/tr&
&tr&&td&′&/td&&td&&/td&&td&8242;&/td&&/tr&
&tr&&td&″&/td&&td&P&/td&&td&8243;&/td&&/tr&
&tr&&td&‾&/td&&td&&/td&&td&8254;&/td&&/tr&
&tr&&td&⁄&/td&&td&&/td&&td&8260;&/td&&/tr&
&tr&&td colspan=3 bgcolor=aaaa&&font color=yellow&字符标记 Letterlike Symbols&/font&&/td&&/tr&
&tr&&td&℘&/td&&td&&/td&&td&8472;&/td&&/tr&
&tr&&td&ℑ&/td&&td&&/td&&td&8465;&/td&&/tr&
&tr&&td&ℜ&/td&&td&&/td&&td&8476;&/td&&/tr&
&tr&&td&™&/td&&td&&/td&&td&8482;&/td&&/tr&
&tr&&td&ℵ&/td&&td&&/td&&td&8501;&/td&&/tr&
&tr&&td colspan=3 bgcolor=aaaa&&font color=yellow&箭头 Arrows&/font&&/td&&/tr&
&tr&&td&←&/td&&td&&/td&&td&8592;&/td&&/tr&
&tr&&td&↑&/td&&td&&/td&&td&8593;&/td&&/tr&
&tr&&td&→&/td&&td&&/td&&td&8594;&/td&&/tr&
&tr&&td&↓&/td&&td&&/td&&td&8595;&/td&&/tr&
&tr&&td&↔&/td&&td&&/td&&td&8596;&/td&&/tr&
&tr&&td&↵&/td&&td&&/td&&td&8629;&/td&&/tr&
&tr&&td&⇐&/td&&td&lA&/td&&td&8656;&/td&&/tr&
&tr&&td&⇑&/td&&td&uA&/td&&td&8657;&/td&&/tr&
&tr&&td&⇒&/td&&td&rA&/td&&td&8658;&/td&&/tr&
&tr&&td&⇓&/td&&td&dA&/td&&td&8659;&/td&&/tr&
&tr&&td&⇔&/td&&td&hA&/td&&td&8660;&/td&&/tr&
&tr&&td colspan=3 bgcolor=aaaa&&font color=yellow&数学符号 Mathematical Operators&/font&&/td&&/tr&
&tr&&td&∀&/td&&td&&/td&&td&8704;&/td&&/tr&
&tr&&td&∂&/td&&td&&/td&&td&8706;&/td&&/tr&
&tr&&td&∃&/td&&td&&/td&&td&8707;&/td&&/tr&
&tr&&td&∅&/td&&td&&/td&&td&8709;&/td&&/tr&
&tr&&td&∇&/td&&td&&/td&&td&8711;&/td&&/tr&
&tr&&td&∈&/td&&td&&/td&&td&8712;&/td&&/tr&
&tr&&td&∉&/td&&td&&/td&&td&8713;&/td&&/tr&
&tr&&td&∋&/td&&td&&/td&&td&8715;&/td&&/tr&
&tr&&td&∏&/td&&td&&/td&&td&8719;&/td&&/tr&
&tr&&td&∑&/td&&td&&/td&&td&8721;&/td&&/tr&
&tr&&td&−&/td&&td&&/td&&td&8722;&/td&&/tr&
&tr&&td&∗&/td&&td&&/td&&td&8727;&/td&&/tr&
&tr&&td&√&/td&&td&&/td&&td&8730;&/td&&/tr&
&tr&&td&∝&/td&&td&&/td&&td&8733;&/td&&/tr&
&tr&&td&∞&/td&&td&&/td&&td&8734;&/td&&/tr&
&tr&&td&∠&/td&&td&&/td&&td&8736;&/td&&/tr&
&tr&&td&∧&/td&&td&&/td&&td&8869;&/td&&/tr&
&tr&&td&∨&/td&&td&&/td&&td&8870;&/td&&/tr&
&tr&&td&∩&/td&&td&&/td&&td&8745;&/td&&/tr&
&tr&&td&∪&/td&&td&&/td&&td&8746;&/td&&/tr&
&tr&&td&∫&/td&&td&&/td&&td&8747;&/td&&/tr&
&tr&&td&∴&/td&&td∴&/td&&td&8756;&/td&&/tr&
&tr&&td&∼&/td&&td&&/td&&td&8764;&/td&&/tr&
&tr&&td&≅&/td&&td&&/td&&td&8773;&/td&&/tr&
&tr&&td&≠&/td&&td&&/td&&td&8800;&/td&&/tr&
&tr&&td&≡&/td&&td&&/td&&td&8801;&/td&&/tr&
&tr&&td&≤&/td&&td&&/td&&td&8804;&/td&&/tr&
&tr&&td&≥&/td&&td&&/td&&td&8805;&/td&&/tr&
&tr&&td&⊂&/td&&td&&/td&&td&8834;&/td&&/tr&
&tr&&td&⊃&/td&&td&&/td&&td&8835;&/td&&/tr&
&tr&&td&⊄&/td&&td&&/td&&td&8836;&/td&&/tr&
&tr&&td&⊆&/td&&td&&/td&&td&8838;&/td&&/tr&
&tr&&td&⊇&/td&&td&&/td&&td&8839;&/td&&/tr&
&tr&&td&&/td&&td&&/td&&td&8853;&/td&&/tr&
&tr&&td&⊗&/td&&td&&/td&&td&8855;&/td&&/tr&
&tr&&td&⊥&/td&&td&&/td&&td&8869;&/td&&/tr&
&tr&&td&⋅&/td&&td&&/td&&td&8901;&/td&&/tr&
&tr&&td colspan=3 bgcolor=aaaa&&font color=yellow&其他技术符号 Miscellaneous Technical&/font&&/td&&/tr&
&tr&&td&⌈&/td&&td&&/td&&td&8968;&/td&&/tr&
&tr&&td&⌉&/td&&td&&/td&&td&8969;&/td&&/tr&
&tr&&td&⌊&/td&&td&&/td&&td&8970;&/td&&/tr&
&tr&&td&⌋&/td&&td&&/td&&td&8971;&/td&&/tr&
&tr&&td&〈&/td&&td&&/td&&td&9001;&/td&&/tr&
&tr&&td&〉&/td&&td&&/td&&td&9002;&/td&&/tr&
&tr&&td colspan=3 bgcolor=aaaa&&font color=yellow&几何图形 Geometric Shapes&/font&&/td&&/tr&
&tr&&td&◊&/td&&td&&/td&&td&9674;&/td&&/tr&
&tr&&td colspan=3 bgcolor=aaaa&&font color=yellow&其他标记 Miscellaneous Symbols&/font&&/td&&/tr&
&tr&&td&♠&/td&&td&&/td&&td&9824;&/td&&/tr&
&tr&&td&♣&/td&&td&&/td&&td&9827;&/td&&/tr&
&tr&&td&♥&/td&&td&&/td&&td&9829;&/td&&/tr&
&tr&&td&♦&/td&&td&&/td&&td&9830;&/td&&/tr&
&br&&br&&br&
&p&&font color=red&//作者:南阳理工学院软件学院,任彬玉 联系:, &/font&&/p&
&a href="/Dev/HTML/jsrun/"&欢迎访问阿里西西网页特效集&/a&
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
( 09:57:36)
( 09:35:26)
( 14:37:16)
( 14:35:13)
( 14:01:26)
( 13:21:18)
( 11:42:05)
( 11:06:08)
相关排行总榜
Copyright & 2004 - . All Rights Reserved. &&粤ICP备号/ schoolShop
项目语言:JAVASCRIPT
权限:read-only(如需更高权限请先加入项目)
schoolShop/
Index: flow.js
===================================================================
--- flow.js (revision 0)
+++ flow.js (revision 16)
@@ -0,0 +1,1022 @@
+&use strict&;
+var _interopRequireDefault = require(&babel-runtime/helpers/interop-require-default&)[&default&];
+exports.__esModule =
+var _tokenizerTypes = require(&../tokenizer/types&);
+var _parser = require(&../parser&);
+var _parser2 = _interopRequireDefault(_parser);
+var pp = _parser2[&default&].
+pp.flowParseTypeInitialiser = function (tok) {
var oldInType = this.state.inT
this.state.inType =
this.expect(tok || _tokenizerTypes.types.colon);
var type = this.flowParseType();
this.state.inType = oldInT
+pp.flowParseDeclareClass = function (node) {
this.next();
this.flowParseInterfaceish(node, true);
return this.finishNode(node, &DeclareClass&);
+pp.flowParseDeclareFunction = function (node) {
this.next();
var id = node.id = this.parseIdentifier();
var typeNode = this.startNode();
var typeContainer = this.startNode();
if (this.isRelational(&&&)) {
typeNode.typeParameters = this.flowParseTypeParameterDeclaration();
typeNode.typeParameters =
this.expect(_tokenizerTypes.types.parenL);
var tmp = this.flowParseFunctionTypeParams();
typeNode.params = tmp.
typeNode.rest = tmp.
this.expect(_tokenizerTypes.types.parenR);
typeNode.returnType = this.flowParseTypeInitialiser();
typeContainer.typeAnnotation = this.finishNode(typeNode, &FunctionTypeAnnotation&);
id.typeAnnotation = this.finishNode(typeContainer, &TypeAnnotation&);
this.finishNode(id, id.type);
this.semicolon();
return this.finishNode(node, &DeclareFunction&);
+pp.flowParseDeclare = function (node) {
if (this.match(_tokenizerTypes.types._class)) {
return this.flowParseDeclareClass(node);
} else if (this.match(_tokenizerTypes.types._function)) {
return this.flowParseDeclareFunction(node);
} else if (this.match(_tokenizerTypes.types._var)) {
return this.flowParseDeclareVariable(node);
} else if (this.isContextual(&module&)) {
return this.flowParseDeclareModule(node);
this.unexpected();
+pp.flowParseDeclareVariable = function (node) {
this.next();
node.id = this.flowParseTypeAnnotatableIdentifier();
this.semicolon();
return this.finishNode(node, &DeclareVariable&);
+pp.flowParseDeclareModule = function (node) {
this.next();
if (this.match(_tokenizerTypes.types.string)) {
node.id = this.parseExprAtom();
node.id = this.parseIdentifier();
var bodyNode = node.body = this.startNode();
var body = bodyNode.body = [];
this.expect(_tokenizerTypes.types.braceL);
while (!this.match(_tokenizerTypes.types.braceR)) {
var node2 = this.startNode();
// todo: declare check
this.next();
body.push(this.flowParseDeclare(node2));
this.expect(_tokenizerTypes.types.braceR);
this.finishNode(bodyNode, &BlockStatement&);
return this.finishNode(node, &DeclareModule&);
+// Interfaces
+pp.flowParseInterfaceish = function (node, allowStatic) {
node.id = this.parseIdentifier();
if (this.isRelational(&&&)) {
node.typeParameters = this.flowParseTypeParameterDeclaration();
node.typeParameters =
node[&extends&] = [];
if (this.eat(_tokenizerTypes.types._extends)) {
node[&extends&].push(this.flowParseInterfaceExtends());
} while (this.eat(_ma));
node.body = this.flowParseObjectType(allowStatic);
+pp.flowParseInterfaceExtends = function () {
var node = this.startNode();
node.id = this.parseIdentifier();
if (this.isRelational(&&&)) {
node.typeParameters = this.flowParseTypeParameterInstantiation();
node.typeParameters =
return this.finishNode(node, &InterfaceExtends&);
+pp.flowParseInterface = function (node) {
this.flowParseInterfaceish(node, false);
return this.finishNode(node, &InterfaceDeclaration&);
+// Type aliases
+pp.flowParseTypeAlias = function (node) {
node.id = this.parseIdentifier();
if (this.isRelational(&&&)) {
node.typeParameters = this.flowParseTypeParameterDeclaration();
node.typeParameters =
node.right = this.flowParseTypeInitialiser(_tokenizerTypes.types.eq);
this.semicolon();
return this.finishNode(node, &TypeAlias&);
+// Type annotations
+pp.flowParseTypeParameterDeclaration = function () {
var node = this.startNode();
node.params = [];
this.expectRelational(&&&);
while (!this.isRelational(&&&)) {
node.params.push(this.flowParseExistentialTypeParam() || this.flowParseTypeAnnotatableIdentifier());
if (!this.isRelational(&&&)) {
this.expect(_ma);
this.expectRelational(&&&);
return this.finishNode(node, &TypeParameterDeclaration&);
+pp.flowParseExistentialTypeParam = function () {
if (this.match(_tokenizerTypes.types.star)) {
var node = this.startNode();
this.next();
return this.finishNode(node, &ExistentialTypeParam&);
+pp.flowParseTypeParameterInstantiation = function () {
var node = this.startNode(),
oldInType = this.state.inT
node.params = [];
this.state.inType =
this.expectRelational(&&&);
while (!this.isRelational(&&&)) {
node.params.push(this.flowParseExistentialTypeParam() || this.flowParseType());
if (!this.isRelational(&&&)) {
this.expect(_ma);
this.expectRelational(&&&);
this.state.inType = oldInT
return this.finishNode(node, &TypeParameterInstantiation&);
+pp.flowParseObjectPropertyKey = function () {
return this.match(_tokenizerTypes.types.num) || this.match(_tokenizerTypes.types.string) ? this.parseExprAtom() : this.parseIdentifier(true);
+pp.flowParseObjectTypeIndexer = function (node, isStatic) {
node[&static&] = isS
this.expect(_tokenizerTypes.types.bracketL);
node.id = this.flowParseObjectPropertyKey();
node.key = this.flowParseTypeInitialiser();
this.expect(_tokenizerTypes.types.bracketR);
node.value = this.flowParseTypeInitialiser();
this.flowObjectTypeSemicolon();
return this.finishNode(node, &ObjectTypeIndexer&);
+pp.flowParseObjectTypeMethodish = function (node) {
node.params = [];
node.rest =
node.typeParameters =
if (this.isRelational(&&&)) {
node.typeParameters = this.flowParseTypeParameterDeclaration();
this.expect(_tokenizerTypes.types.parenL);
while (this.match(_tokenizerTypes.types.name)) {
node.params.push(this.flowParseFunctionTypeParam());
if (!this.match(_tokenizerTypes.types.parenR)) {
this.expect(_ma);
if (this.eat(_tokenizerTypes.types.ellipsis)) {
node.rest = this.flowParseFunctionTypeParam();
this.expect(_tokenizerTypes.types.parenR);
node.returnType = this.flowParseTypeInitialiser();
return this.finishNode(node, &FunctionTypeAnnotation&);
+pp.flowParseObjectTypeMethod = function (startPos, startLoc, isStatic, key) {
var node = this.startNodeAt(startPos, startLoc);
node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(startPos, startLoc));
node[&static&] = isS
node.key =
node.optional =
this.flowObjectTypeSemicolon();
return this.finishNode(node, &ObjectTypeProperty&);
+pp.flowParseObjectTypeCallProperty = function (node, isStatic) {
var valueNode = this.startNode();
node[&static&] = isS
node.value = this.flowParseObjectTypeMethodish(valueNode);
this.flowObjectTypeSemicolon();
return this.finishNode(node, &ObjectTypeCallProperty&);
+pp.flowParseObjectType = function (allowStatic) {
var nodeStart = this.startNode();
var node =
var propertyKey =
var isStatic =
nodeStart.callProperties = [];
nodeStart.properties = [];
nodeStart.indexers = [];
this.expect(_tokenizerTypes.types.braceL);
while (!this.match(_tokenizerTypes.types.braceR)) {
var optional =
var startPos = this.state.start,
startLoc = this.state.startL
node = this.startNode();
if (allowStatic && this.isContextual(&static&)) {
this.next();
isStatic =
if (this.match(_tokenizerTypes.types.bracketL)) {
nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic));
} else if (this.match(_tokenizerTypes.types.parenL) || this.isRelational(&&&)) {
nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, allowStatic));
if (isStatic && this.match(_tokenizerTypes.types.colon)) {
propertyKey = this.parseIdentifier();
propertyKey = this.flowParseObjectPropertyKey();
if (this.isRelational(&&&) || this.match(_tokenizerTypes.types.parenL)) {
// This is a method property
nodeStart.properties.push(this.flowParseObjectTypeMethod(startPos, startLoc, isStatic, propertyKey));
if (this.eat(_tokenizerTypes.types.question)) {
optional =
node.key = propertyK
node.value = this.flowParseTypeInitialiser();
node.optional =
node[&static&] = isS
this.flowObjectTypeSemicolon();
nodeStart.properties.push(this.finishNode(node, &ObjectTypeProperty&));
this.expect(_tokenizerTypes.types.braceR);
return this.finishNode(nodeStart, &ObjectTypeAnnotation&);
+pp.flowObjectTypeSemicolon = function () {
if (!this.eat(_tokenizerTypes.types.semi) && !this.eat(_ma) && !this.match(_tokenizerTypes.types.braceR)) {
this.unexpected();
+pp.flowParseGenericType = function (startPos, startLoc, id) {
var node = this.startNodeAt(startPos, startLoc);
node.typeParameters =
while (this.eat(_tokenizerTypes.types.dot)) {
var node2 = this.startNodeAt(startPos, startLoc);
node2.qualification = node.
node2.id = this.parseIdentifier();
node.id = this.finishNode(node2, &QualifiedTypeIdentifier&);
if (this.isRelational(&&&)) {
node.typeParameters = this.flowParseTypeParameterInstantiation();
return this.finishNode(node, &GenericTypeAnnotation&);
+pp.flowParseTypeofType = function () {
var node = this.startNode();
this.expect(_tokenizerTypes.types._typeof);
node.argument = this.flowParsePrimaryType();
return this.finishNode(node, &TypeofTypeAnnotation&);
+pp.flowParseTupleType = function () {
var node = this.startNode();
node.types = [];
this.expect(_tokenizerTypes.types.bracketL);
// We allow trailing commas
while (this.state.pos & this.input.length && !this.match(_tokenizerTypes.types.bracketR)) {
node.types.push(this.flowParseType());
if (this.match(_tokenizerTypes.types.bracketR))
this.expect(_ma);
this.expect(_tokenizerTypes.types.bracketR);
return this.finishNode(node, &TupleTypeAnnotation&);
+pp.flowParseFunctionTypeParam = function () {
var optional =
var node = this.startNode();
node.name = this.parseIdentifier();
if (this.eat(_tokenizerTypes.types.question)) {
optional =
node.optional =
node.typeAnnotation = this.flowParseTypeInitialiser();
return this.finishNode(node, &FunctionTypeParam&);
+pp.flowParseFunctionTypeParams = function () {
var ret = { params: [], rest: null };
while (this.match(_tokenizerTypes.types.name)) {
ret.params.push(this.flowParseFunctionTypeParam());
if (!this.match(_tokenizerTypes.types.parenR)) {
this.expect(_ma);
if (this.eat(_tokenizerTypes.types.ellipsis)) {
ret.rest = this.flowParseFunctionTypeParam();
+pp.flowIdentToTypeAnnotation = function (startPos, startLoc, node, id) {
switch (id.name) {
case &any&:
return this.finishNode(node, &AnyTypeAnnotation&);
case &void&:
return this.finishNode(node, &VoidTypeAnnotation&);
case &bool&:
case &boolean&:
return this.finishNode(node, &BooleanTypeAnnotation&);
case &mixed&:
return this.finishNode(node, &MixedTypeAnnotation&);
case &number&:
return this.finishNode(node, &NumberTypeAnnotation&);
case &string&:
return this.finishNode(node, &StringTypeAnnotation&);
return this.flowParseGenericType(startPos, startLoc, id);
+// The parsing of types roughly parallels the parsing of expressions, and
+// primary types are kind of like primary expressions...they're the
+// primitives with which other types are constructed.
+pp.flowParsePrimaryType = function () {
var startPos = this.state.start,
startLoc = this.state.startL
var node = this.startNode();
var type =
var isGroupedType =
switch (this.state.type) {
case _tokenizerTypes.types.name:
return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdentifier());
case _tokenizerTypes.types.braceL:
return this.flowParseObjectType();
case _tokenizerTypes.types.bracketL:
return this.flowParseTupleType();
case _tokenizerTypes.types.relational:
if (this.state.value === &&&) {
node.typeParameters = this.flowParseTypeParameterDeclaration();
this.expect(_tokenizerTypes.types.parenL);
tmp = this.flowParseFunctionTypeParams();
node.params = tmp.
node.rest = tmp.
this.expect(_tokenizerTypes.types.parenR);
this.expect(_tokenizerTypes.types.arrow);
node.returnType = this.flowParseType();
return this.finishNode(node, &FunctionTypeAnnotation&);
case _tokenizerTypes.types.parenL:
this.next();
// Check to see if this is actually a grouped type
if (!this.match(_tokenizerTypes.types.parenR) && !this.match(_tokenizerTypes.types.ellipsis)) {
if (this.match(_tokenizerTypes.types.name)) {
var token = this.lookahead().
isGroupedType = token !== _tokenizerTypes.types.question && token !== _tokenizerTypes.types.
isGroupedType =
if (isGroupedType) {
type = this.flowParseType();
this.expect(_tokenizerTypes.types.parenR);
// If we see a =& next then someone was probably confused about
// function types, so we can provide a better error message
if (this.eat(_tokenizerTypes.types.arrow)) {
this.raise(node, &Unexpected token =&. It looks like & + &you are trying to write a function type, but you ended up & + &writing a grouped type followed by an =&, which is a syntax & + &error. Remember, function type parameters are named so function & + &types look like (name1: type1, name2: type2) =& returnType. You & + &probably wrote (type1) =& returnType&);
tmp = this.flowParseFunctionTypeParams();
node.params = tmp.
node.rest = tmp.
this.expect(_tokenizerTypes.types.parenR);
this.expect(_tokenizerTypes.types.arrow);
node.returnType = this.flowParseType();
node.typeParameters =
return this.finishNode(node, &FunctionTypeAnnotation&);
case _tokenizerTypes.types.string:
node.value = this.state.
this.addExtra(node, &rawValue&, node.value);
this.addExtra(node, &raw&, this.input.slice(this.state.start, this.state.end));
this.next();
return this.finishNode(node, &StringLiteralTypeAnnotation&);
case _tokenizerTypes.types._true:case _tokenizerTypes.types._false:
node.value = this.match(_tokenizerTypes.types._true);
this.next();
return this.finishNode(node, &BooleanLiteralTypeAnnotation&);
case _tokenizerTypes.types.num:
node.value = this.state.
this.addExtra(node, &rawValue&, node.value);
this.addExtra(node, &raw&, this.input.slice(this.state.start, this.state.end));
this.next();
return this.finishNode(node, &NumericLiteralTypeAnnotation&);
case _tokenizerTypes.types._null:
node.value = this.match(_tokenizerTypes.types._null);
this.next();
return this.finishNode(node, &NullLiteralTypeAnnotation&);
if (this.state.type.keyword === &typeof&) {
return this.flowParseTypeofType();
this.unexpected();
+pp.flowParsePostfixType = function () {
var node = this.startNode();
var type = node.elementType = this.flowParsePrimaryType();
if (this.match(_tokenizerTypes.types.bracketL)) {
this.expect(_tokenizerTypes.types.bracketL);
this.expect(_tokenizerTypes.types.bracketR);
return this.finishNode(node, &ArrayTypeAnnotation&);
+pp.flowParsePrefixType = function () {
var node = this.startNode();
if (this.eat(_tokenizerTypes.types.question)) {
node.typeAnnotation = this.flowParsePrefixType();
return this.finishNode(node, &NullableTypeAnnotation&);
return this.flowParsePostfixType();
+pp.flowParseIntersectionType = function () {
var node = this.startNode();
var type = this.flowParsePrefixType();
node.types = [type];
while (this.eat(_tokenizerTypes.types.bitwiseAND)) {
node.types.push(this.flowParsePrefixType());
return node.types.length === 1 ? type : this.finishNode(node, &IntersectionTypeAnnotation&);
+pp.flowParseUnionType = function () {
var node = this.startNode();
var type = this.flowParseIntersectionType();
node.types = [type];
while (this.eat(_tokenizerTypes.types.bitwiseOR)) {
node.types.push(this.flowParseIntersectionType());
return node.types.length === 1 ? type : this.finishNode(node, &UnionTypeAnnotation&);
+pp.flowParseType = function () {
var oldInType = this.state.inT
this.state.inType =
var type = this.flowParseUnionType();
this.state.inType = oldInT
+pp.flowParseTypeAnnotation = function () {
var node = this.startNode();
node.typeAnnotation = this.flowParseTypeInitialiser();
return this.finishNode(node, &TypeAnnotation&);
+pp.flowParseTypeAnnotatableIdentifier = function (requireTypeAnnotation, canBeOptionalParam) {
var ident = this.parseIdentifier();
var isOptionalParam =
if (canBeOptionalParam && this.eat(_tokenizerTypes.types.question)) {
this.expect(_tokenizerTypes.types.question);
isOptionalParam =
if (requireTypeAnnotation || this.match(_tokenizerTypes.types.colon)) {
ident.typeAnnotation = this.flowParseTypeAnnotation();
this.finishNode(ident, ident.type);
if (isOptionalParam) {
ident.optional =
this.finishNode(ident, ident.type);
+exports[&default&] = function (instance) {
// plain function return types: function name(): string {}
instance.extend(&parseFunctionBody&, function (inner) {
return function (node, allowExpression) {
if (this.match(_tokenizerTypes.types.colon) && !allowExpression) {
// if allowExpression is true then we're parsing an arrow function and if
// there's a return type then it's been handled elsewhere
node.returnType = this.flowParseTypeAnnotation();
return inner.call(this, node, allowExpression);
// interfaces
instance.extend(&parseStatement&, function (inner) {
return function (declaration, topLevel) {
// strict mode handling of `interface` since it's a reserved word
if (this.state.strict && this.match(_tokenizerTypes.types.name) && this.state.value === &interface&) {
var node = this.startNode();
this.next();
return this.flowParseInterface(node);
return inner.call(this, declaration, topLevel);
// declares, interfaces and type aliases
instance.extend(&parseExpressionStatement&, function (inner) {
return function (node, expr) {
if (expr.type === &Identifier&) {
if (expr.name === &declare&) {
if (this.match(_tokenizerTypes.types._class) || this.match(_tokenizerTypes.types.name) || this.match(_tokenizerTypes.types._function) || this.match(_tokenizerTypes.types._var)) {
return this.flowParseDeclare(node);
} else if (this.match(_tokenizerTypes.types.name)) {
if (expr.name === &interface&) {
return this.flowParseInterface(node);
} else if (expr.name === &type&) {
return this.flowParseTypeAlias(node);
return inner.call(this, node, expr);
// export type
instance.extend(&shouldParseExportDeclaration&, function (inner) {
return function () {
return this.isContextual(&type&) || inner.call(this);
instance.extend(&parseParenItem&, function () {
return function (node, startLoc, startPos, forceArrow /*:: ?*/) {
var canBeArrow = this.state.potentialArrowAt = startP
if (this.match(_tokenizerTypes.types.colon)) {
var typeCastNode = this.startNodeAt(startLoc, startPos);
typeCastNode.expression =
typeCastNode.typeAnnotation = this.flowParseTypeAnnotation();
if (forceArrow && !this.match(_tokenizerTypes.types.arrow)) {
this.unexpected();
if (canBeArrow && this.eat(_tokenizerTypes.types.arrow)) {
// ((lol): number =& {});
var params = node.type === &SequenceExpression& ? node.expressions : [node];
var func = this.parseArrowExpression(this.startNodeAt(startLoc, startPos), params);
func.returnType = typeCastNode.typeA
return this.finishNode(typeCastNode, &TypeCastExpression&);
instance.extend(&parseExport&, function (inner) {
return function (node) {
node = inner.call(this, node);
if (node.type === &ExportNamedDeclaration&) {
node.exportKind = node.exportKind || &value&;
instance.extend(&parseExportDeclaration&, function (inner) {
return function (node) {
if (this.isContextual(&type&)) {
node.exportKind = &type&;
var declarationNode = this.startNode();
this.next();
if (this.match(_tokenizerTypes.types.braceL)) {
// export type { foo, bar };
node.specifiers = this.parseExportSpecifiers();
this.parseExportFrom(node);
// export type Foo = B
return this.flowParseTypeAlias(declarationNode);
return inner.call(this, node);
instance.extend(&parseClassId&, function (inner) {
return function (node) {
inner.apply(this, arguments);
if (this.isRelational(&&&)) {
node.typeParameters = this.flowParseTypeParameterDeclaration();
// don't consider `void` to be a keyword as then it'll use the void token type
// and set startExpr
instance.extend(&isKeyword&, function (inner) {
return function (name) {
if (this.state.inType && name === &void&) {
return inner.call(this, name);
// ensure that inside flow types, we bypass the jsx parser plugin
instance.extend(&readToken&, function (inner) {
return function (code) {
if (this.state.inType && (code === 62 || code === 60)) {
return this.finishOp(_tokenizerTypes.types.relational, 1);
return inner.call(this, code);
// don't lex any token as a jsx one inside a flow type
instance.extend(&jsx_readToken&, function (inner) {
return function () {
if (!this.state.inType) return inner.call(this);
function typeCastToParameter(node) {
node.expression.typeAnnotation = node.typeA
return node.
instance.extend(&toAssignable&, function (inner) {
return function (node) {
if (node.type === &TypeCastExpression&) {
return typeCastToParameter(node);
return inner.apply(this, arguments);
// turn type casts that we found in function parameter head into type annotated params
instance.extend(&toAssignableList&, function (inner) {
return function (exprList, isBinding) {
for (var i = 0; i & exprList. i++) {
var expr = exprList[i];
if (expr && expr.type === &TypeCastExpression&) {
exprList[i] = typeCastToParameter(expr);
return inner.call(this, exprList, isBinding);
// this is a list of nodes, from something like a call expression, we need to filter the
// type casts that we've found that are illegal in this context
instance.extend(&toReferencedList&, function () {
return function (exprList) {
for (var i = 0; i & exprList. i++) {
var expr = exprList[i];
if (expr && expr._exprListItem && expr.type === &TypeCastExpression&) {
this.raise(expr.start, &Unexpected type cast&);
return exprL
// parse an item inside a expression list eg. `(NODE, NODE)` where NODE represents
// the position where ed
instance.extend(&parseExprListItem&, function (inner) {
return function (allowEmpty, refShorthandDefaultPos) {
var container = this.startNode();
var node = inner.call(this, allowEmpty, refShorthandDefaultPos);
if (this.match(_tokenizerTypes.types.colon)) {
container._exprListItem =
container.expression =
container.typeAnnotation = this.flowParseTypeAnnotation();
return this.finishNode(container, &TypeCastExpression&);
instance.extend(&checkLVal&, function (inner) {
return function (node) {
if (node.type !== &TypeCastExpression&) {
return inner.apply(this, arguments);
// parse class property type annotations
instance.extend(&parseClassProperty&, function (inner) {
return function (node) {
if (this.match(_tokenizerTypes.types.colon)) {
node.typeAnnotation = this.flowParseTypeAnnotation();
return inner.call(this, node);
// determine whether or not we're currently in the position where a class property would appear
instance.extend(&isClassProperty&, function (inner) {
return function () {
return this.match(_tokenizerTypes.types.colon) || inner.call(this);
// parse type parameters for class methods
instance.extend(&parseClassMethod&, function () {
return function (classBody, method, isGenerator, isAsync) {
if (this.isRelational(&&&)) {
method.typeParameters = this.flowParseTypeParameterDeclaration();
this.parseMethod(method, isGenerator, isAsync);
classBody.body.push(this.finishNode(method, &ClassMethod&));
// parse a the super class type parameters and implements
instance.extend(&parseClassSuper&, function (inner) {
return function (node, isStatement) {
inner.call(this, node, isStatement);
if (node.superClass && this.isRelational(&&&)) {
node.superTypeParameters = this.flowParseTypeParameterInstantiation();
if (this.isContextual(&implements&)) {
this.next();
var implemented = node[&implements&] = [];
var _node = this.startNode();
_node.id = this.parseIdentifier();
if (this.isRelational(&&&)) {
_node.typeParameters = this.flowParseTypeParameterInstantiation();
_node.typeParameters =
implemented.push(this.finishNode(_node, &ClassImplements&));
} while (this.eat(_ma));
// parse type parameters for object method shorthand
instance.extend(&parseObjPropValue&, function (inner) {
return function (prop) {
var typeParameters =
// method shorthand
if (this.isRelational(&&&)) {
typeParameters = this.flowParseTypeParameterDeclaration();
if (!this.match(_tokenizerTypes.types.parenL)) this.unexpected();
inner.apply(this, arguments);
// add typeParameters if we found them
if (typeParameters) {
(prop.value || prop).typeParameters = typeP
instance.extend(&parseAssignableListItemTypes&, function () {
return function (param) {
if (this.eat(_tokenizerTypes.types.question)) {
param.optional =
if (this.match(_tokenizerTypes.types.colon)) {
param.typeAnnotation = this.flowParseTypeAnnotation();
this.finishNode(param, param.type);
// parse typeof and type imports
instance.extend(&parseImportSpecifiers&, function (inner) {
return function (node) {
node.importKind = &value&;
var kind =
if (this.match(_tokenizerTypes.types._typeof)) {
kind = &typeof&;
} else if (this.isContextual(&type&)) {
kind = &type&;
if (kind) {
var lh = this.lookahead();
if (lh.type === _tokenizerTypes.types.name && lh.value !== &from& || lh.type === _tokenizerTypes.types.braceL || lh.type === _tokenizerTypes.types.star) {
this.next();
node.importKind =
inner.call(this, node);
// parse function type parameters - function foo&T&() {}
instance.extend(&parseFunctionParams&, function (inner) {
return function (node) {
if (this.isRelational(&&&)) {
node.typeParameters = this.flowParseTypeParameterDeclaration();
inner.call(this, node);
// parse flow type annotations on variable declarator heads - let foo: string = bar
instance.extend(&parseVarHead&, function (inner) {
return function (decl) {
inner.call(this, decl);
if (this.match(_tokenizerTypes.types.colon)) {
decl.id.typeAnnotation = this.flowParseTypeAnnotation();
this.finishNode(decl.id, decl.id.type);
// parse the return type of an async arrow function - let foo = (async (): number =& {});
instance.extend(&parseAsyncArrowFromCallExpression&, function (inner) {
return function (node, call) {
if (this.match(_tokenizerTypes.types.colon)) {
node.returnType = this.flowParseTypeAnnotation();
return inner.call(this, node, call);
// todo description
instance.extend(&shouldParseAsyncArrow&, function (inner) {
return function () {
return this.match(_tokenizerTypes.types.colon) || inner.call(this);
// handle return types for arrow functions
instance.extend(&parseParenAndDistinguishExpression&, function (inner) {
return function (startPos, startLoc, canBeArrow, isAsync) {
startPos = startPos || this.state.
startLoc = startLoc || this.state.startL
if (canBeArrow && this.lookahead().type === _tokenizerTypes.types.parenR) {
// let foo = (): number =& {};
this.expect(_tokenizerTypes.types.parenL);
this.expect(_tokenizerTypes.types.parenR);
var node = this.startNodeAt(startPos, startLoc);
if (this.match(_tokenizerTypes.types.colon)) node.returnType = this.flowParseTypeAnnotation();
this.expect(_tokenizerTypes.types.arrow);
return this.parseArrowExpression(node, [], isAsync);
// let foo = (foo): number =& {};
var node = inner.call(this, startPos, startLoc, canBeArrow, isAsync);
if (this.match(_tokenizerTypes.types.colon)) {
var state = this.state.clone();
return this.parseParenItem(node, startPos, startLoc, true);
} catch (err) {
if (err instanceof SyntaxError) {
this.state =
+module.exports = exports[&default&];
\ No newline at end of file
Index: jsx/index.js
===================================================================
--- jsx/index.js (revision 0)
+++ jsx/index.js (revision 16)
@@ -0,0 +1,464 @@
+&use strict&;
+var _interopRequireDefault = require(&babel-runtime/helpers/interop-require-default&)[&default&];
+exports.__esModule =
+var _xhtml = require(&./xhtml&);
+var _xhtml2 = _interopRequireDefault(_xhtml);
+var _tokenizerTypes = require(&../../tokenizer/types&);
+var _tokenizerContext = require(&../../tokenizer/context&);
+var _parser = require(&../../parser&);
+var _parser2 = _interopRequireDefault(_parser);
+var _utilIdentifier = require(&../../util/identifier&);
+var _utilWhitespace = require(&../../util/whitespace&);
+var HEX_NUMBER = /^[\da-fA-F]+$/;
+var DECIMAL_NUMBER = /^\d+$/;
+_tokenizerContext.types.j_oTag = new _tokenizerContext.TokContext(&&tag&, false);
+_tokenizerContext.types.j_cTag = new _tokenizerContext.TokContext(&&/tag&, false);
+_tokenizerContext.types.j_expr = new _tokenizerContext.TokContext(&&tag&...&/tag&&, true, true);
+_tokenizerTypes.types.jsxName = new _tokenizerTypes.TokenType(&jsxName&);
+_tokenizerTypes.types.jsxText = new _tokenizerTypes.TokenType(&jsxText&, { beforeExpr: true });
+_tokenizerTypes.types.jsxTagStart = new _tokenizerTypes.TokenType(&jsxTagStart&);
+_tokenizerTypes.types.jsxTagEnd = new _tokenizerTypes.TokenType(&jsxTagEnd&);
+_tokenizerTypes.types.jsxTagStart.updateContext = function () {
this.state.context.push(_tokenizerContext.types.j_expr); // treat as beginning of JSX expression
this.state.context.push(_tokenizerContext.types.j_oTag); // start opening tag context
this.state.exprAllowed =
+_tokenizerTypes.types.jsxTagEnd.updateContext = function (prevType) {
var out = this.state.context.pop();
if (out === _tokenizerContext.types.j_oTag && prevType === _tokenizerTypes.types.slash || out === _tokenizerContext.types.j_cTag) {
this.state.context.pop();
this.state.exprAllowed = this.curContext() === _tokenizerContext.types.j_
this.state.exprAllowed =
+var pp = _parser2[&default&].
+// Reads inline JSX contents token.
+pp.jsxReadToken = function () {
var out = &&;
var chunkStart = this.state.
for (;;) {
if (this.state.pos &= this.input.length) {
this.raise(this.state.start, &Unterminated JSX contents&);
var ch = this.input.charCodeAt(this.state.pos);
switch (ch) {
case 60: // &&&
if (this.state.pos === this.state.start) {
if (ch === 60 && this.state.exprAllowed) {
++this.state.
return this.finishToken(_tokenizerTypes.types.jsxTagStart);
return this.getTokenFromCode(ch);
out += this.input.slice(chunkStart, this.state.pos);
return this.finishToken(_tokenizerTypes.types.jsxText, out);
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadEntity();
chunkStart = this.state.
if (_utilWhitespace.isNewLine(ch)) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadNewLine(true);
chunkStart = this.state.
++this.state.
+pp.jsxReadNewLine = function (normalizeCRLF) {
var ch = this.input.charCodeAt(this.state.pos);
++this.state.
if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) {
++this.state.
out = normalizeCRLF ? &\n& : &\r\n&;
out = String.fromCharCode(ch);
++this.state.curL
this.state.lineStart = this.state.
+pp.jsxReadString = function (quote) {
var out = &&;
var chunkStart = ++this.state.
for (;;) {
if (this.state.pos &= this.input.length) {
this.raise(this.state.start, &Unterminated string constant&);
var ch = this.input.charCodeAt(this.state.pos);
if (ch === quote)
if (ch === 38) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadEntity();
chunkStart = this.state.
} else if (_utilWhitespace.isNewLine(ch)) {
out += this.input.slice(chunkStart, this.state.pos);
out += this.jsxReadNewLine(false);
chunkStart = this.state.
++this.state.
out += this.input.slice(chunkStart, this.state.pos++);
return this.finishToken(_tokenizerTypes.types.string, out);
+pp.jsxReadEntity = function () {
var str = &&;
var count = 0;
var entity =
var ch = this.input[this.state.pos];
var startPos = ++this.state.
while (this.state.pos & this.input.length && count++ & 10) {
ch = this.input[this.state.pos++];
if (ch === &;&) {
if (str[0] === &#&) {
if (str[1] === &x&) {
str = str.substr(2);
if (HEX_NUMBER.test(str)) entity = String.fromCharCode(parseInt(str, 16));
str = str.substr(1);
if (DECIMAL_NUMBER.test(str)) entity = String.fromCharCode(parseInt(str, 10));
entity = _xhtml2[&default&][str];
if (!entity) {
this.state.pos = startP
return &&&;
+// Read a JSX identifier (valid tag or attribute name).
+// Optimized version since JSX identifiers can&t contain
+// escape characters and so can be read as single slice.
+// Also assumes that first character was already checked
+// by isIdentifierStart in readToken.
+pp.jsxReadWord = function () {
var start = this.state.
ch = this.input.charCodeAt(++this.state.pos);
} while (_utilIdentifier.isIdentifierChar(ch) || ch === 45); // &-&
return this.finishToken(_tokenizerTypes.types.jsxName, this.input.slice(start, this.state.pos));
+// Transforms JSX element name to string.
+function getQualifiedJSXName(object) {
if (object.type === &JSXIdentifier&) {
return object.
if (object.type === &JSXNamespacedName&) {
return object.namespace.name + &:& + object.name.
if (object.type === &JSXMemberExpression&) {
return getQualifiedJSXName(object.object) + &.& + getQualifiedJSXName(object.property);
+// Parse next token as JSX identifier
+pp.jsxParseIdentifier = function () {
var node = this.startNode();
if (this.match(_tokenizerTypes.types.jsxName)) {
node.name = this.state.
} else if (this.state.type.keyword) {
node.name = this.state.type.
this.unexpected();
this.next();
return this.finishNode(node, &JSXIdentifier&);
+// Parse namespaced identifier.
+pp.jsxParseNamespacedName = function () {
var startPos = this.state.start,
startLoc = this.state.startL
var name = this.jsxParseIdentifier();
if (!this.eat(_tokenizerTypes.types.colon))
var node = this.startNodeAt(startPos, startLoc);
node.namespace =
node.name = this.jsxParseIdentifier();
return this.finishNode(node, &JSXNamespacedName&);
+// Parses element name in any form - namespaced, member
+// or single identifier.
+pp.jsxParseElementName = function () {
var startPos = this.state.start,
startLoc = this.state.startL
var node = this.jsxParseNamespacedName();
while (this.eat(_tokenizerTypes.types.dot)) {
var newNode = this.startNodeAt(startPos, startLoc);
newNode.object =
newNode.property = this.jsxParseIdentifier();
node = this.finishNode(newNode, &JSXMemberExpression&);
+// Parses any type of JSX attribute value.
+pp.jsxParseAttributeValue = function () {
var node =
switch (this.state.type) {
case _tokenizerTypes.types.braceL:
node = this.jsxParseExpressionContainer();
if (node.expression.type === &JSXEmptyExpression&) {
this.raise(node.start, &JSX attributes must only be assigned a non-empty expression&);
case _tokenizerTypes.types.jsxTagStart:
case _tokenizerTypes.types.string:
node = this.parseExprAtom();
node.extra =
this.raise(this.state.start, &JSX value should be either an expression or a quoted JSX text&);
+// JSXEmptyExpression is unique type since it doesn't actually parse anything,
+// and so it should start at the end of last read token (left brace) and finish
+// at the beginning of the next one (right brace).
+pp.jsxParseEmptyExpression = function () {
var node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc);
return this.finishNodeAt(node, &JSXEmptyExpression&, this.start, this.startLoc);
+// Parses JSX expression enclosed into curly brackets.
+pp.jsxParseExpressionContainer = function () {
var node = this.startNode();
this.next();
if (this.match(_tokenizerTypes.types.braceR)) {
node.expression = this.jsxParseEmptyExpression();
node.expression = this.parseExpression();
this.expect(_tokenizerTypes.types.braceR);
return this.finishNode(node, &JSXExpressionContainer&);
+// Parses following JSX attribute name-value pair.
+pp.jsxParseAttribute = function () {
var node = this.startNode();
if (this.eat(_tokenizerTypes.types.braceL)) {
this.expect(_tokenizerTypes.types.ellipsis);
node.argument = this.parseMaybeAssign();
this.expect(_tokenizerTypes.types.braceR);
return this.finishNode(node, &JSXSpreadAttribute&);
node.name = this.jsxParseNamespacedName();
node.value = this.eat(_tokenizerTypes.types.eq) ? this.jsxParseAttributeValue() :
return this.finishNode(node, &JSXAttribute&);
+// Parses JSX opening tag starting after &&&.
+pp.jsxParseOpeningElementAt = function (startPos, startLoc) {
var node = this.startNodeAt(startPos, startLoc);
node.attributes = [];
node.name = this.jsxParseElementName();
while (!this.match(_tokenizerTypes.types.slash) && !this.match(_tokenizerTypes.types.jsxTagEnd)) {
node.attributes.push(this.jsxParseAttribute());
node.selfClosing = this.eat(_tokenizerTypes.types.slash);
this.expect(_tokenizerTypes.types.jsxTagEnd);
return this.finishNode(node, &JSXOpeningElement&);
+// Parses JSX closing tag starting after &&/&.
+pp.jsxParseClosingElementAt = function (startPos, startLoc) {
var node = this.startNodeAt(startPos, startLoc);
node.name = this.jsxParseElementName();
this.expect(_tokenizerTypes.types.jsxTagEnd);
return this.finishNode(node, &JSXClosingElement&);
+// Parses entire JSX element, including it&s opening tag
+// (starting after &&&), attributes, contents and closing tag.
+pp.jsxParseElementAt = function (startPos, startLoc) {
var node = this.startNodeAt(startPos, startLoc);
var children = [];
var openingElement = this.jsxParseOpeningElementAt(startPos, startLoc);
var closingElement =
if (!openingElement.selfClosing) {
contents: for (;;) {
switch (this.state.type) {
case _tokenizerTypes.types.jsxTagStart:
startPos = this.state.startLoc = this.state.startL
this.next();
if (this.eat(_tokenizerTypes.types.slash)) {
closingElement = this.jsxParseClosingElementAt(startPos, startLoc);
children.push(this.jsxParseElementAt(startPos, startLoc));
case _tokenizerTypes.types.jsxText:
children.push(this.parseExprAtom());
case _tokenizerTypes.types.braceL:
children.push(this.jsxParseExpressionContainer());
this.unexpected();
if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
this.raise(closingElement.start, &Expected corresponding JSX closing tag for && + getQualifiedJSXName(openingElement.name) + &&&);
node.openingElement = openingE
node.closingElement = closingE
node.children =
if (this.match(_tokenizerTypes.types.relational) && this.state.value === &&&) {
this.raise(this.state.start, &Adjacent JSX elements must be wrapped in an enclosing tag&);
return this.finishNode(node, &JSXElement&);
+// Parses entire JSX element from current position.
+pp.jsxParseElement = function () {
var startPos = this.state.start,
startLoc = this.state.startL
this.next();
return this.jsxParseElementAt(startPos, startLoc);
+exports[&default&] = function (instance) {
instance.extend(&parseExprAtom&, function (inner) {
return function (refShortHandDefaultPos) {
if (this.match(_tokenizerTypes.types.jsxText)) {
var node = this.parseLiteral(this.state.value, &JSXText&);
// /babel/babel/issues/2078
node.extra =
} else if (this.match(_tokenizerTypes.types.jsxTagStart)) {
return this.jsxParseElement();
return inner.call(this, refShortHandDefaultPos);
instance.extend(&readToken&, function (inner) {
return function (code) {
var context = this.curContext();
if (context === _tokenizerContext.types.j_expr) {
return this.jsxReadToken();
if (context === _tokenizerContext.types.j_oTag || context === _tokenizerContext.types.j_cTag) {
if (_utilIdentifier.isIdentifierStart(code)) {
return this.jsxReadWord();
if (code === 62) {
++this.state.
return this.finishToken(_tokenizerTypes.types.jsxTagEnd);
if ((code === 34 || code === 39) && context === _tokenizerContext.types.j_oTag) {
return this.jsxReadString(code);
if (code === 60 && this.state.exprAllowed) {
++this.state.
return this.finishToken(_tokenizerTypes.types.jsxTagStart);
return inner.call(this, code);
instance.extend(&updateContext&, function (inner) {
return function (prevType) {
if (this.match(_tokenizerTypes.types.braceL)) {
var curContext = this.curContext();
if (curContext === _tokenizerContext.types.j_oTag) {
this.state.context.push(_tokenizerContext.types.b_expr);
} else if (curContext === _tokenizerContext.types.j_expr) {
this.state.context.push(_tokenizerContext.types.b_tmpl);
inner.call(this, prevType);
this.state.exprAllowed =
} else if (this.match(_tokenizerTypes.types.slash) && prevType === _tokenizerTypes.types.jsxTagStart) {
this.state.context.length -= 2; // do not consider JSX expr -& JSX open tag -& ... anymore
this.state.context.push(_tokenizerContext.types.j_cTag); // reconsider as closing tag context
this.state.exprAllowed =
return inner.call(this, prevType);
+module.exports = exports[&default&];
\ No newline at end of file
Index: jsx/xhtml.js
===================================================================
--- jsx/xhtml.js (revision 0)
+++ jsx/xhtml.js (revision 16)
@@ -0,0 +1,259 @@
+&use strict&;
+exports.__esModule =
+exports[&default&] = {
quot: &\&&,
apos: &'&,
nbsp: & &,
iexcl: &?&,
cent: &?&,
pound: &?&,
curren: &¤&,
brvbar: &?&,
sect: &§&,
uml: &¨&,
copy: &(C)&,
ordf: &?&,
laquo: &<>&,
frac14: & 1/4 &,
frac12: & 1/2 &,
frac34: & 3/4 &,
iquest: &?&,
Agrave: &?&,
Aacute: &?&,
Acirc: &?&,
Atilde: &?&,
Auml: &?&,
Aring: &?&,
AElig: &AE&,
Ccedil: &?&,
Egrave: &?&,
Eacute: &?&,
Ecirc: &?&,
Euml: &?&,
Igrave: &?&,
Iacute: &?&,
Icirc: &?&,
Iuml: &?&,
Ntilde: &?&,
Ograve: &?&,
Oacute: &?&,
Ocirc: &?&,
Otilde: &?&,
Ouml: &?&,
times: &×&,
Oslash: &?&,
Ugrave: &?&,
Uacute: &?&,
Ucirc: &?&,
Uuml: &?&,
Yacute: &?&,
THORN: &?&,
szlig: &ss&,
agrave: &à&,
aacute: &á&,
acirc: &?&,
atilde: &?&,
auml: &?&,
aring: &?&,
aelig: &ae&,
ccedil: &?&,
egrave: &è&,
eacute: &é&,
ecirc: &ê&,
euml: &?&,
igrave: &ì&,
iacute: &í&,
icirc: &?&,
iuml: &?&,
ntilde: &?&,
ograve: &ò&,
oacute: &ó&,
ocirc: &?&,
otilde: &?&,
ouml: &?&,
divide: &÷&,
oslash: &?&,
ugrave: &ù&,
uacute: &ú&,
ucirc: &?&,
uuml: &ü&,
yacute: &?&,
thorn: &?&,
yuml: &?&,
OElig: &OE&,
oelig: &oe&,
Scaron: &?&,
scaron: &?&,
Yuml: &?&,
fnof: &?&,
circ: &^&,
tilde: &~&,
Alpha: &Α&,
Beta: &Β&,
Gamma: &Γ&,
Delta: &Δ&,
Epsilon: &Ε&,
Zeta: &Ζ&,
Eta: &Η&,
Theta: &Θ&,
Iota: &Ι&,
Kappa: &Κ&,
Lambda: &Λ&,
Omicron: &Ο&,
Rho: &Ρ&,
Sigma: &Σ&,
Tau: &Τ&,
Upsilon: &Υ&,
Phi: &Φ&,
Chi: &Χ&,
Psi: &Ψ&,
Omega: &Ω&,
alpha: &α&,
beta: &β&,
gamma: &γ&,
delta: &δ&,
epsilon: &ε&,
zeta: &ζ&,
eta: &η&,
theta: &θ&,
iota: &ι&,
kappa: &κ&,
lambda: &λ&,
omicron: &ο&,
rho: &ρ&,
sigmaf: &?&,
sigma: &σ&,
tau: &τ&,
upsilon: &υ&,
phi: &φ&,
chi: &χ&,
psi: &ψ&,
omega: &ω&,
thetasym: &?&,
upsih: &?&,
ensp: & &,
emsp: & &,
thinsp: & &,
zwnj: &?&,
ndash: &–&,
mdash: &—&,
lsquo: &‘&,
rsquo: &’&,
sbquo: &,&,
ldquo: &“&,
rdquo: &”&,
bdquo: &,,&,
dagger: &+&,
Dagger: &?&,
bull: &o&,
hellip: &…&,
permil: &‰&,
prime: &′&,
Prime: &″&,
lsaquo: &&,
oline: &?&,
frasl: &/&,
euro: &EUR&,
image: &I&,
weierp: &?&,
real: &R&,
trade: &(TM)&,
alefsym: &?&,
larr: &←&,
uarr: &↑&,
rarr: &→&,
darr: &↓&,
crarr: &?&,
dArr: &?&,
forall: &?&,
part: &?&,
exist: &?&,
empty: &?&,
nabla: &?&,
isin: &∈&,
notin: &?&,
prod: &∏&,
sum: &∑&,
minus: &-&,
lowast: &*&,
radic: &√&,
prop: &∝&,
infin: &∞&,
ang: &∠&,
and: &∧&,
cap: &∩&,
cup: &∪&,
&int&: &∫&,
there4: &∴&,
cong: &?&,
asymp: &≈&,
equiv: &≡&,
nsub: &?&,
sube: &?&,
supe: &?&,
oplus: &⊕&,
otimes: &?&,
perp: &⊥&,
sdot: &?&,
lceil: &?&,
rceil: &?&,
lfloor: &?&,
rfloor: &?&,
lang: &?&,
rang: &?&,
spades: &?&,
clubs: &?&,
hearts: &?&,
diams: &?&
+module.exports = exports[&default&];
\ No newline at end of file
(C)&&2013&&Alibaba&&Inc.&&All&&rights&&resvered.
Powered by

我要回帖

更多关于 infinidock设置 的文章

 

随机推荐