Remove capitalized TRUE and FALSE (don't remember why I had those in the first place)

This commit is contained in:
Davide P. Cervone 2012-01-11 13:55:39 -05:00
parent 756ef39804
commit 568b919f70
12 changed files with 175 additions and 176 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -206,10 +206,9 @@ MathJax.ElementJax.mml.Augment({
});
(function (MML) {
var FALSE = false; var TRUE = true;
MML.mbase = MathJax.Object.Subclass({
type: "base", isToken: FALSE,
type: "base", isToken: false,
defaults: {
mathbackground: MML.INHERIT,
mathcolor: MML.INHERIT
@ -218,12 +217,12 @@ MathJax.ElementJax.mml.Augment({
noInheritAttribute: {
texClass: true
},
linebreakContainer: FALSE,
linebreakContainer: false,
Init: function () {
this.data = [];
if (this.inferRow && !(arguments.length === 1 && arguments[0].inferred))
{this.Append(MML.mrow().With({inferred: TRUE}))}
{this.Append(MML.mrow().With({inferred: true}))}
this.Append.apply(this,arguments);
},
With: function (def) {
@ -345,8 +344,8 @@ MathJax.ElementJax.mml.Augment({
[ 1,-1, 2, 3, 1, 0, 1, 1] // INNER
],
autoDefault: function (name) {return ""},
isSpacelike: function () {return FALSE},
isEmbellished: function () {return FALSE},
isSpacelike: function () {return false},
isEmbellished: function () {return false},
Core: function () {return this},
CoreMO: function () {return this},
lineBreak: function () { // FIXME: should be removed (and from elements below) when SVG is converted to new linebreak style
@ -354,19 +353,19 @@ MathJax.ElementJax.mml.Augment({
},
hasNewline: function () {
if (this.isEmbellished()) {return this.CoreMO().hasNewline()}
if (this.isToken || this.linebreakContainer) {return FALSE}
if (this.isToken || this.linebreakContainer) {return false}
for (var i = 0, m = this.data.length; i < m; i++) {
if (this.data[i] && this.data[i].hasNewline()) {return TRUE}
if (this.data[i] && this.data[i].hasNewline()) {return true}
}
return FALSE;
return false;
},
array: function () {if (this.inferred) {return this.data} else {return [this]}},
toString: function () {return this.type+"("+this.data.join(",")+")"}
},{
childrenSpacelike: function () {
for (var i = 0, m = this.data.length; i < m; i++)
{if (!this.data[i].isSpacelike()) {return FALSE}}
return TRUE;
{if (!this.data[i].isSpacelike()) {return false}}
return true;
},
childEmbellished: function () {
return (this.data[0] && this.data[0].isEmbellished());
@ -400,7 +399,7 @@ MathJax.ElementJax.mml.Augment({
});
MML.mi = MML.mbase.Subclass({
type: "mi", isToken: TRUE,
type: "mi", isToken: true,
texClass: MML.TEXCLASS.ORD,
defaults: {
mathvariant: MML.AUTO,
@ -419,7 +418,7 @@ MathJax.ElementJax.mml.Augment({
});
MML.mn = MML.mbase.Subclass({
type: "mn", isToken: TRUE,
type: "mn", isToken: true,
texClass: MML.TEXCLASS.ORD,
defaults: {
mathvariant: MML.INHERIT,
@ -430,7 +429,7 @@ MathJax.ElementJax.mml.Augment({
});
MML.mo = MML.mbase.Subclass({
type: "mo", isToken: TRUE,
type: "mo", isToken: true,
defaults: {
mathvariant: MML.INHERIT,
mathsize: MML.INHERIT,
@ -463,17 +462,17 @@ MathJax.ElementJax.mml.Augment({
},
defaultDef: {
form: MML.FORM.INFIX,
fence: FALSE,
separator: FALSE,
fence: false,
separator: false,
lspace: MML.LENGTH.THICKMATHSPACE,
rspace: MML.LENGTH.THICKMATHSPACE,
stretchy: FALSE,
symmetric: TRUE,
stretchy: false,
symmetric: true,
maxsize: MML.SIZE.INFINITY,
minsize: '0em', //'1em',
largeop: FALSE,
movablelimits: FALSE,
accent: FALSE,
largeop: false,
movablelimits: false,
accent: false,
linebreak: MML.LINEBREAK.AUTO,
lineleading: "1ex",
linebreakstyle: "before",
@ -545,7 +544,7 @@ MathJax.ElementJax.mml.Augment({
}
return MML.FORM.INFIX;
},
isEmbellished: function () {return TRUE},
isEmbellished: function () {return true},
hasNewline: function () {return (this.Get("linebreak") === MML.LINEBREAK.NEWLINE)},
lineBreak: function () {
var values = this.getValues("linebreak","linebreakstyle");
@ -581,8 +580,8 @@ MathJax.ElementJax.mml.Augment({
});
MML.mtext = MML.mbase.Subclass({
type: "mtext", isToken: TRUE,
isSpacelike: function () {return TRUE},
type: "mtext", isToken: true,
isSpacelike: function () {return true},
texClass: MML.TEXCLASS.ORD,
defaults: {
mathvariant: MML.INHERIT,
@ -593,8 +592,8 @@ MathJax.ElementJax.mml.Augment({
});
MML.mspace = MML.mbase.Subclass({
type: "mspace", isToken: TRUE,
isSpacelike: function () {return TRUE},
type: "mspace", isToken: true,
isSpacelike: function () {return true},
defaults: {
mathbackground: MML.INHERIT,
mathcolor: MML.INHERIT,
@ -611,7 +610,7 @@ MathJax.ElementJax.mml.Augment({
});
MML.ms = MML.mbase.Subclass({
type: "ms", isToken: TRUE,
type: "ms", isToken: true,
texClass: MML.TEXCLASS.ORD,
defaults: {
mathvariant: MML.INHERIT,
@ -624,7 +623,7 @@ MathJax.ElementJax.mml.Augment({
});
MML.mglyph = MML.mbase.Subclass({
type: "mglyph", isToken: TRUE,
type: "mglyph", isToken: true,
texClass: MML.TEXCLASS.ORD,
defaults: {
mathbackground: MML.INHERIT,
@ -640,15 +639,15 @@ MathJax.ElementJax.mml.Augment({
MML.mrow = MML.mbase.Subclass({
type: "mrow",
isSpacelike: MML.mbase.childrenSpacelike,
inferred: FALSE,
inferred: false,
isEmbellished: function () {
var isEmbellished = FALSE;
var isEmbellished = false;
for (var i = 0, m = this.data.length; i < m; i++) {
if (this.data[i] == null) continue;
if (this.data[i].isEmbellished()) {
if (isEmbellished) {return FALSE}
isEmbellished = TRUE; this.core = i;
} else if (!this.data[i].isSpacelike()) {return FALSE}
if (isEmbellished) {return false}
isEmbellished = true; this.core = i;
} else if (!this.data[i].isSpacelike()) {return false}
}
return isEmbellished;
},
@ -690,7 +689,7 @@ MathJax.ElementJax.mml.Augment({
MML.mfrac = MML.mbase.Subclass({
type: "mfrac", num: 0, den: 1,
linebreakContainer: TRUE,
linebreakContainer: true,
texClass: MML.TEXCLASS.INNER,
isEmbellished: MML.mbase.childEmbellished,
Core: MML.mbase.childCore,
@ -701,9 +700,9 @@ MathJax.ElementJax.mml.Augment({
linethickness: MML.LINETHICKNESS.MEDIUM,
numalign: MML.ALIGN.CENTER,
denomalign: MML.ALIGN.CENTER,
bevelled: FALSE
bevelled: false
},
adjustChild_displaystyle: function (n) {return FALSE},
adjustChild_displaystyle: function (n) {return false},
adjustChild_scriptlevel: function (n) {
var level = this.Get("scriptlevel");
if (!this.Get("displaystyle") || level > 0) {level++}
@ -718,19 +717,19 @@ MathJax.ElementJax.mml.Augment({
MML.msqrt = MML.mbase.Subclass({
type: "msqrt",
inferRow: TRUE,
linebreakContainer: TRUE,
inferRow: true,
linebreakContainer: true,
texClass: MML.TEXCLASS.ORD,
setTeXclass: MML.mbase.setSeparateTeXclasses,
adjustChild_texprimestyle: function (n) {return TRUE}
adjustChild_texprimestyle: function (n) {return true}
});
MML.mroot = MML.mbase.Subclass({
type: "mroot",
linebreakContainer: TRUE,
linebreakContainer: true,
texClass: MML.TEXCLASS.ORD,
adjustChild_displaystyle: function (n) {
if (n === 1) {return FALSE}
if (n === 1) {return false}
return this.Get("displaystyle");
},
adjustChild_scriptlevel: function (n) {
@ -739,7 +738,7 @@ MathJax.ElementJax.mml.Augment({
return level;
},
adjustChild_texprimestyle: function (n) {
if (n === 0) {return TRUE};
if (n === 0) {return true};
return this.Get("texprimestyle");
},
setTeXclass: MML.mbase.setSeparateTeXclasses
@ -751,7 +750,7 @@ MathJax.ElementJax.mml.Augment({
isEmbellished: MML.mbase.childEmbellished,
Core: MML.mbase.childCore,
CoreMO: MML.mbase.childCoreMO,
inferRow: TRUE,
inferRow: true,
defaults: {
scriptlevel: MML.INHERIT,
displaystyle: MML.INHERIT,
@ -774,24 +773,24 @@ MathJax.ElementJax.mml.Augment({
}
return level;
},
inheritFromMe: TRUE,
inheritFromMe: true,
noInherit: {
mpadded: {width: TRUE, height: TRUE, depth: TRUE, lspace: TRUE, voffset: TRUE},
mtable: {width: TRUE, height: TRUE, depth: TRUE, align: TRUE}
mpadded: {width: true, height: true, depth: true, lspace: true, voffset: true},
mtable: {width: true, height: true, depth: true, align: true}
},
setTeXclass: MML.mbase.setChildTeXclass
});
MML.merror = MML.mbase.Subclass({
type: "merror",
inferRow: TRUE,
linebreakContainer: TRUE,
inferRow: true,
linebreakContainer: true,
texClass: MML.TEXCLASS.ORD
});
MML.mpadded = MML.mbase.Subclass({
type: "mpadded",
inferRow: TRUE,
inferRow: true,
isSpacelike: MML.mbase.childrenSpacelike,
isEmbellished: MML.mbase.childEmbellished,
Core: MML.mbase.childCore,
@ -811,7 +810,7 @@ MathJax.ElementJax.mml.Augment({
MML.mphantom = MML.mbase.Subclass({
type: "mphantom",
texClass: MML.TEXCLASS.ORD,
inferRow: TRUE,
inferRow: true,
isSpacelike: MML.mbase.childrenSpacelike,
isEmbellished: MML.mbase.childEmbellished,
Core: MML.mbase.childCore,
@ -870,8 +869,8 @@ MathJax.ElementJax.mml.Augment({
MML.menclose = MML.mbase.Subclass({
type: "menclose",
inferRow: TRUE,
linebreakContainer: TRUE,
inferRow: true,
linebreakContainer: true,
defaults: {
mathbackground: MML.INHERIT,
mathcolor: MML.INHERIT,
@ -883,7 +882,7 @@ MathJax.ElementJax.mml.Augment({
MML.msubsup = MML.mbase.Subclass({
type: "msubsup", base: 0, sub: 1, sup: 2,
linebreakContainer: TRUE,
linebreakContainer: true,
isEmbellished: MML.mbase.childEmbellished,
Core: MML.mbase.childCore,
CoreMO: MML.mbase.childCoreMO,
@ -900,7 +899,7 @@ MathJax.ElementJax.mml.Augment({
return 0;
},
adjustChild_displaystyle: function (n) {
if (n > 0) {return FALSE}
if (n > 0) {return false}
return this.Get("displaystyle");
},
adjustChild_scriptlevel: function (n) {
@ -909,7 +908,7 @@ MathJax.ElementJax.mml.Augment({
return level;
},
adjustChild_texprimestyle: function (n) {
if (n === this.sub) {return TRUE}
if (n === this.sub) {return true}
return this.Get("texprimestyle");
},
setTeXclass: MML.mbase.setBaseTeXclasses
@ -920,7 +919,7 @@ MathJax.ElementJax.mml.Augment({
MML.mmultiscripts = MML.msubsup.Subclass({
type: "mmultiscripts",
adjustChild_texprimestyle: function (n) {
if (n % 2 === 1) {return TRUE}
if (n % 2 === 1) {return true}
return this.Get("texprimestyle");
}
});
@ -931,7 +930,7 @@ MathJax.ElementJax.mml.Augment({
type: "munderover",
base: 0, under: 1, over: 2, sub: 1, sup: 2,
ACCENTS: ["", "accentunder", "accent"],
linebreakContainer: TRUE,
linebreakContainer: true,
isEmbellished: MML.mbase.childEmbellished,
Core: MML.mbase.childCore,
CoreMO: MML.mbase.childCoreMO,
@ -950,10 +949,10 @@ MathJax.ElementJax.mml.Augment({
{return (this.isEmbellished() ? this.CoreMO().Get(name) : MML.TEXCLASS.ORD)}
if (name === "accent" && this.data[this.over]) {return this.data[this.over].CoreMO().Get("accent")}
if (name === "accentunder" && this.data[this.under]) {return this.data[this.under].CoreMO().Get("accent")}
return FALSE;
return false;
},
adjustChild_displaystyle: function (n) {
if (n > 0) {return FALSE}
if (n > 0) {return false}
return this.Get("displaystyle");
},
adjustChild_scriptlevel: function (n) {
@ -965,7 +964,7 @@ MathJax.ElementJax.mml.Augment({
return level;
},
adjustChild_texprimestyle: function (n) {
if (n === this.base && this.data[this.over]) {return TRUE}
if (n === this.base && this.data[this.over]) {return true}
return this.Get("texprimestyle");
},
setTeXclass: MML.mbase.setBaseTeXclasses
@ -986,7 +985,7 @@ MathJax.ElementJax.mml.Augment({
rowalign: MML.ALIGN.BASELINE,
columnalign: MML.ALIGN.CENTER,
groupalign: "{left}",
alignmentscope: TRUE,
alignmentscope: true,
columnwidth: MML.WIDTH.AUTO,
width: MML.WIDTH.AUTO,
rowspacing: "1ex",
@ -995,25 +994,25 @@ MathJax.ElementJax.mml.Augment({
columnlines: MML.LINES.NONE,
frame: MML.LINES.NONE,
framespacing: "0.4em 0.5ex",
equalrows: FALSE,
equalcolumns: FALSE,
displaystyle: FALSE,
equalrows: false,
equalcolumns: false,
displaystyle: false,
side: MML.SIDE.RIGHT,
minlabelspacing: "0.8em",
texClass: MML.TEXCLASS.ORD,
useHeight: 1
},
inheritFromMe: TRUE,
inheritFromMe: true,
noInherit: {
mtable: {
align: TRUE, rowalign: TRUE, columnalign: TRUE, groupalign: TRUE,
alignmentscope: TRUE, columnwidth: TRUE, width: TRUE, rowspacing: TRUE,
columnspacing: TRUE, rowlines: TRUE, columnlines: TRUE, frame: TRUE,
framespacing: TRUE, equalrows: TRUE, equalcolumns: TRUE,
side: TRUE, minlabelspacing: TRUE, texClass: TRUE, useHeight: 1
align: true, rowalign: true, columnalign: true, groupalign: true,
alignmentscope: true, columnwidth: true, width: true, rowspacing: true,
columnspacing: true, rowlines: true, columnlines: true, frame: true,
framespacing: true, equalrows: true, equalcolumns: true,
side: true, minlabelspacing: true, texClass: true, useHeight: 1
}
},
linebreakContainer: TRUE,
linebreakContainer: true,
Append: function () {
for (var i = 0, m = arguments.length; i < m; i++) {
if (!((arguments[i] instanceof MML.mtr) ||
@ -1033,12 +1032,12 @@ MathJax.ElementJax.mml.Augment({
columnalign: MML.INHERIT,
groupalign: MML.INHERIT
},
inheritFromMe: TRUE,
inheritFromMe: true,
noInherit: {
mrow: {rowalign: TRUE, columnalign: TRUE, groupalign: TRUE},
mtable: {rowalign: TRUE, columnalign: TRUE, groupalign: TRUE}
mrow: {rowalign: true, columnalign: true, groupalign: true},
mtable: {rowalign: true, columnalign: true, groupalign: true}
},
linebreakContainer: TRUE,
linebreakContainer: true,
Append: function () {
for (var i = 0, m = arguments.length; i < m; i++) {
if (!(arguments[i] instanceof MML.mtd)) {arguments[i] = MML.mtd(arguments[i])}
@ -1050,8 +1049,8 @@ MathJax.ElementJax.mml.Augment({
MML.mtd = MML.mbase.Subclass({
type: "mtd",
inferRow: TRUE,
linebreakContainer: TRUE,
inferRow: true,
linebreakContainer: true,
isEmbellished: MML.mbase.childEmbellished,
Core: MML.mbase.childCore,
CoreMO: MML.mbase.childCoreMO,
@ -1069,16 +1068,16 @@ MathJax.ElementJax.mml.Augment({
MML.maligngroup = MML.mbase.Subclass({
type: "malign",
isSpacelike: function () {return TRUE},
isSpacelike: function () {return true},
defaults: {
mathbackground: MML.INHERIT,
mathcolor: MML.INHERIT,
groupalign: MML.INHERIT
},
inheritFromMe: TRUE,
inheritFromMe: true,
noInherit: {
mrow: {groupalign: TRUE},
mtable: {groupalign: TRUE}
mrow: {groupalign: true},
mtable: {groupalign: true}
}
});
@ -1089,7 +1088,7 @@ MathJax.ElementJax.mml.Augment({
mathcolor: MML.INHERIT,
edge: MML.SIDE.LEFT
},
isSpacelike: function () {return TRUE}
isSpacelike: function () {return true}
});
MML.mlabeledtr = MML.mtr.Subclass({
@ -1124,8 +1123,8 @@ MathJax.ElementJax.mml.Augment({
setTeXclass: MML.mbase.setChildTeXclass
});
MML.annotation = MML.mbase.Subclass({
type: "annotation", isToken: TRUE,
linebreakContainer: TRUE,
type: "annotation", isToken: true,
linebreakContainer: true,
defaults: {
definitionURL: null,
encoding: null,
@ -1175,13 +1174,13 @@ MathJax.ElementJax.mml.Augment({
indentalignlast: MML.INDENTALIGN.INDENTALIGN,
indentshiftlast: MML.INDENTSHIFT.INDENTSHIFT,
decimalseparator: ".",
texprimestyle: FALSE // is it in TeX's C' style?
texprimestyle: false // is it in TeX's C' style?
},
autoDefault: function (name) {
if (name === "displaystyle") {return this.Get("display") === "block"}
return "";
},
linebreakContainer: TRUE,
linebreakContainer: true,
setTeXclass: MML.mbase.setChildTeXclass
});
@ -1253,7 +1252,7 @@ MathJax.ElementJax.mml.Augment({
MML.TeXAtom = MML.mbase.Subclass({
type: "texatom",
inferRow: TRUE,
inferRow: true,
texClass: MML.TEXCLASS.ORD,
setTeXclass: function (prev) {
this.getPrevClass(prev);

View File

@ -24,7 +24,7 @@
*/
(function (TEX,HUB,AJAX) {
var TRUE = true, FALSE = false, MML, NBSP = "\u00A0";
var MML, NBSP = "\u00A0";
var STACK = MathJax.Object.Subclass({
Init: function (env,inner) {
@ -39,7 +39,7 @@
item = arguments[i];
if (item instanceof MML.mbase) {item = STACKITEM.mml(item)}
item.global = this.global;
top = (this.data.length ? this.Top().checkItem(item) : TRUE);
top = (this.data.length ? this.Top().checkItem(item) : true);
if (top instanceof Array) {this.Pop(); this.Push.apply(this,top)}
else if (top instanceof STACKITEM) {this.Pop(); this.Push(top)}
else if (top) {
@ -82,19 +82,19 @@
Push: function () {this.data.push.apply(this.data,arguments)},
Pop: function () {return this.data.pop()},
mmlData: function (inferred,forceRow) {
if (inferred == null) {inferred = TRUE}
if (inferred == null) {inferred = true}
if (this.data.length === 1 && !forceRow) {return this.data[0]}
return MML.mrow.apply(MML,this.data).With((inferred ? {inferred: TRUE}: {}));
return MML.mrow.apply(MML,this.data).With((inferred ? {inferred: true}: {}));
},
checkItem: function (item) {
if (item.type === "over" && this.isOpen) {item.num = this.mmlData(FALSE); this.data = []}
if (item.type === "over" && this.isOpen) {item.num = this.mmlData(false); this.data = []}
if (item.type === "cell" && this.isOpen) {
if (item.linebreak) {return FALSE}
if (item.linebreak) {return false}
TEX.Error("Misplaced "+item.name);
}
if (item.isClose && this[item.type+"Error"]) {TEX.Error(this[item.type+"Error"])}
if (!item.isNotStack) {return TRUE}
this.Push(item.data[0]); return FALSE;
if (!item.isNotStack) {return true}
this.Push(item.data[0]); return false;
},
With: function (def) {
for (var id in def) {if (def.hasOwnProperty(id)) {this[id] = def[id]}}
@ -104,7 +104,7 @@
});
STACKITEM.start = STACKITEM.Subclass({
type: "start", isOpen: TRUE,
type: "start", isOpen: true,
Init: function (global) {
this.SUPER(arguments).Init.call(this);
this.global = global;
@ -116,15 +116,15 @@
});
STACKITEM.stop = STACKITEM.Subclass({
type: "stop", isClose: TRUE
type: "stop", isClose: true
});
STACKITEM.open = STACKITEM.Subclass({
type: "open", isOpen: TRUE,
type: "open", isOpen: true,
stopError: "Extra open brace or missing close brace",
checkItem: function (item) {
if (item.type === "close") {
var mml = this.mmlData(); // this.mmlData(TRUE,TRUE); // force row
var mml = this.mmlData(); // this.mmlData(true,true); // force row
return STACKITEM.mml(MML.TeXAtom(mml)); // TeXAtom make it an ORD to prevent spacing (FIXME: should be another way)
}
return this.SUPER(arguments).checkItem.call(this,item);
@ -132,7 +132,7 @@
});
STACKITEM.close = STACKITEM.Subclass({
type: "close", isClose: TRUE
type: "close", isClose: true
});
STACKITEM.subsup = STACKITEM.Subclass({
@ -140,7 +140,7 @@
stopError: "Missing superscript or subscript argument",
checkItem: function (item) {
var script = ["","subscript","superscript"][this.position];
if (item.type === "open" || item.type === "left") {return TRUE}
if (item.type === "open" || item.type === "left") {return true}
if (item.type === "mml") {
this.data[0].SetData(this.position,item.data[0]);
return STACKITEM.mml(this.data[0]);
@ -152,15 +152,15 @@
});
STACKITEM.over = STACKITEM.Subclass({
type: "over", isClose: TRUE, name: "\\over",
type: "over", isClose: true, name: "\\over",
checkItem: function (item,stack) {
if (item.type === "over") {TEX.Error("Ambiguous use of "+item.name)}
if (item.isClose) {
var mml = MML.mfrac(this.num,this.mmlData(FALSE));
var mml = MML.mfrac(this.num,this.mmlData(false));
if (this.thickness != null) {mml.linethickness = this.thickness}
if (this.open || this.close) {
mml.texClass = MML.TEXCLASS.INNER;
mml.texWithDelims = TRUE;
mml.texWithDelims = true;
mml = MML.mfenced(mml).With({open: this.open, close: this.close});
}
return [STACKITEM.mml(mml), item];
@ -171,7 +171,7 @@
});
STACKITEM.left = STACKITEM.Subclass({
type: "left", isOpen: TRUE, delim: '(',
type: "left", isOpen: true, delim: '(',
stopError: "Extra \\left or missing \\right",
checkItem: function (item) {
if (item.type === "right") {
@ -183,11 +183,11 @@
});
STACKITEM.right = STACKITEM.Subclass({
type: "right", isClose: TRUE, delim: ')'
type: "right", isClose: true, delim: ')'
});
STACKITEM.begin = STACKITEM.Subclass({
type: "begin", isOpen: TRUE,
type: "begin", isOpen: true,
checkItem: function (item) {
if (item.type === "end") {
if (item.name !== this.name)
@ -201,7 +201,7 @@
});
STACKITEM.end = STACKITEM.Subclass({
type: "end", isClose: TRUE
type: "end", isClose: true
});
STACKITEM.style = STACKITEM.Subclass({
@ -232,15 +232,15 @@
});
STACKITEM.array = STACKITEM.Subclass({
type: "array", isOpen: TRUE, arraydef: {},
type: "array", isOpen: true, arraydef: {},
Init: function () {
this.table = []; this.row = []; this.env = {}; this.frame = []
this.SUPER(arguments).Init.apply(this,arguments);
},
checkItem: function (item) {
if (item.isClose && item.type !== "over") {
if (item.isEntry) {this.EndEntry(); this.clearEnv(); return FALSE}
if (item.isCR) {this.EndEntry(); this.EndRow(); this.clearEnv(); return FALSE}
if (item.isEntry) {this.EndEntry(); this.clearEnv(); return false}
if (item.isCR) {this.EndEntry(); this.EndRow(); this.clearEnv(); return false}
this.EndTable(); this.clearEnv();
var mml = MML.mtable.apply(MML,this.table).With(this.arraydef);
if (this.frame.length === 4) {
@ -292,11 +292,11 @@
});
STACKITEM.cell = STACKITEM.Subclass({
type: "cell", isClose: TRUE
type: "cell", isClose: true
});
STACKITEM.mml = STACKITEM.Subclass({
type: "mml", isNotStack: TRUE,
type: "mml", isNotStack: true,
Add: function () {this.data.push.apply(this.data,arguments); return this}
});
@ -429,24 +429,24 @@
surd: '221A',
// big ops
coprod: ['2210',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
bigvee: ['22C1',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
bigwedge: ['22C0',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
biguplus: ['2A04',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
bigcap: ['22C2',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
bigcup: ['22C3',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
coprod: ['2210',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
bigvee: ['22C1',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
bigwedge: ['22C0',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
biguplus: ['2A04',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
bigcap: ['22C2',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
bigcup: ['22C3',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
'int': ['222B',{texClass: MML.TEXCLASS.OP}],
intop: ['222B',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE, movablelimits:TRUE}],
intop: ['222B',{texClass: MML.TEXCLASS.OP, movesupsub:true, movablelimits:true}],
iint: ['222C',{texClass: MML.TEXCLASS.OP}],
iiint: ['222D',{texClass: MML.TEXCLASS.OP}],
prod: ['220F',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
sum: ['2211',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
bigotimes: ['2A02',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
bigoplus: ['2A01',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
bigodot: ['2A00',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
prod: ['220F',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
sum: ['2211',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
bigotimes: ['2A02',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
bigoplus: ['2A01',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
bigodot: ['2A00',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
oint: ['222E',{texClass: MML.TEXCLASS.OP}],
bigsqcup: ['2A06',{texClass: MML.TEXCLASS.OP, movesupsub:TRUE}],
smallint: ['222B',{largeop:FALSE}],
bigsqcup: ['2A06',{texClass: MML.TEXCLASS.OP, movesupsub:true}],
smallint: ['222B',{largeop:false}],
// binary operations
triangleleft: '25C3',
@ -469,11 +469,11 @@
bullet: '2219',
wr: '2240',
div: '00F7',
odot: ['2299',{largeop: FALSE}],
oslash: ['2298',{largeop: FALSE}],
otimes: ['2297',{largeop: FALSE}],
ominus: ['2296',{largeop: FALSE}],
oplus: ['2295',{largeop: FALSE}],
odot: ['2299',{largeop: false}],
oslash: ['2298',{largeop: false}],
otimes: ['2297',{largeop: false}],
ominus: ['2296',{largeop: false}],
oplus: ['2295',{largeop: false}],
mp: '2213',
pm: '00B1',
circ: '2218',
@ -643,10 +643,10 @@
},
macros: {
displaystyle: ['SetStyle','D',TRUE,0],
textstyle: ['SetStyle','T',FALSE,0],
scriptstyle: ['SetStyle','S',FALSE,1],
scriptscriptstyle: ['SetStyle','SS',FALSE,2],
displaystyle: ['SetStyle','D',true,0],
textstyle: ['SetStyle','T',false,0],
scriptstyle: ['SetStyle','S',false,1],
scriptscriptstyle: ['SetStyle','SS',false,2],
rm: ['SetFont',MML.VARIANT.NORMAL],
mit: ['SetFont',MML.VARIANT.ITALIC],
@ -1094,7 +1094,7 @@
position = base.sup;
} else if (base.movesupsub) {
if (base.type !== "munderover" || base.data[base.over])
{base = MML.munderover(base,null,null).With({movesupsub:TRUE})}
{base = MML.munderover(base,null,null).With({movesupsub:true})}
position = base.over;
} else {
base = MML.msubsup(base,null,null);
@ -1110,7 +1110,7 @@
position = base.sub;
} else if (base.movesupsub) {
if (base.type !== "munderover" || base.data[base.under])
{base = MML.munderover(base,null,null).With({movesupsub:TRUE})}
{base = MML.munderover(base,null,null).With({movesupsub:true})}
position = base.under;
} else {
base = MML.msubsup(base,null,null);
@ -1126,7 +1126,7 @@
var sup = ""; this.i--;
do {sup += this.PRIME; this.i++, c = this.GetNext()}
while (c === "'" || c === this.SMARTQUOTE);
sup = this.mmlToken(MML.mo(MML.chars(sup)).With({isPrime: TRUE, variantForm: TEX.isSTIX}));
sup = this.mmlToken(MML.mo(MML.chars(sup)).With({isPrime: true, variantForm: TEX.isSTIX}));
this.Push(MML.msup(base,sup));
},
@ -1201,8 +1201,8 @@
if (!id) {id = name.substr(1)};
id = id.replace(/&thinsp;/,"\u2006");
var mml = MML.mo(id).With({
movablelimits: TRUE,
movesupsub: TRUE,
movablelimits: true,
movesupsub: true,
form: MML.FORM.PREFIX,
texClass: MML.TEXCLASS.OP
});
@ -1212,8 +1212,8 @@
Limits: function (name,limits) {
var op = this.stack.Prev("nopop");
if (op.texClass !== MML.TEXCLASS.OP) {TEX.Error(name+" is allowed only on operators")}
op.movesupsub = (limits ? TRUE : FALSE);
op.movablelimits = FALSE;
op.movesupsub = (limits ? true : false);
op.movablelimits = false;
},
Over: function (name,open,close) {
@ -1273,8 +1273,8 @@
var c = this.ParseArg(name);
var def = {accent: true}; if (this.stack.env.font) {def.mathvariant = this.stack.env.font}
var mml = this.mmlToken(MML.mo(MML.entity("#x"+accent)).With(def));
mml.stretchy = (stretchy ? TRUE : FALSE);
this.Push(MML.TeXAtom(MML.munderover(c,null,mml).With({accent: TRUE})));
mml.stretchy = (stretchy ? true : false);
this.Push(MML.TeXAtom(MML.munderover(c,null,mml).With({accent: true})));
},
UnderOver: function (name,c,stack) {
@ -1282,9 +1282,9 @@
var base = this.ParseArg(name);
if (base.Get("movablelimits")) {base.movablelimits = false}
var mml = MML.munderover(base,null,null);
if (stack) {mml.movesupsub = TRUE}
if (stack) {mml.movesupsub = true}
mml.data[mml[pos]] =
this.mmlToken(MML.mo(MML.entity("#x"+c)).With({stretchy:TRUE, accent:(pos == "under")}));
this.mmlToken(MML.mo(MML.entity("#x"+c)).With({stretchy:true, accent:(pos == "under")}));
this.Push(mml);
},
@ -1300,7 +1300,7 @@
TeXAtom: function (name,mclass) {
var def = {texClass: mclass}, mml;
if (mclass == MML.TEXCLASS.OP) {
def.movesupsub = def.movablelimits = TRUE;
def.movesupsub = def.movablelimits = true;
var arg = this.GetArgument(name);
var match = arg.match(/^\s*\\rm\s+([a-zA-Z0-9 ]+)$/);
if (match) {
@ -1411,7 +1411,7 @@
var delim = this.GetDelimiter(name);
this.Push(MML.TeXAtom(MML.mo(delim).With({
minsize: size, maxsize: size, scriptlevel: 0,
fence: TRUE, stretchy: TRUE, symmetric: TRUE
fence: true, stretchy: true, symmetric: true
})).With({texClass: mclass}));
},
@ -1464,21 +1464,21 @@
var c = this.GetNext(); if (c === "") {TEX.Error("Missing argument for "+name)}
if (c === "{") {this.i++} else {this.string = c+"}"+this.string.slice(this.i+1); this.i = 0}
var array = STACKITEM.array().With({
requireClose: TRUE,
requireClose: true,
arraydef: {
rowspacing: (vspacing||"4pt"),
columnspacing: (spacing||"1em")
}
});
if (cases) {array.isCases = TRUE}
if (cases) {array.isCases = true}
if (open || close) {array.open = open; array.close = close}
if (style === "D") {array.arraydef.displaystyle = TRUE}
if (style === "D") {array.arraydef.displaystyle = true}
if (align != null) {array.arraydef.columnalign = align}
this.Push(array);
},
Entry: function (name) {
this.Push(STACKITEM.cell().With({isEntry: TRUE, name: name}));
this.Push(STACKITEM.cell().With({isEntry: true, name: name}));
if (this.stack.Top().isCases) {
var string = this.string;
var braces = 0, i = this.i, m = string.length;
@ -1500,14 +1500,14 @@
},
Cr: function (name) {
this.Push(STACKITEM.cell().With({isCR: TRUE, name: name}));
this.Push(STACKITEM.cell().With({isCR: true, name: name}));
},
CrLaTeX: function (name) {
var n = this.GetBrackets(name,"").replace(/ /g,"");
if (n && !n.match(/^(((\.\d+|\d+(\.\d*)?))(pt|em|ex|mu|mm|cm|in|pc))$/))
{TEX.Error("Bracket argument to "+name+" must be a dimension")}
this.Push(STACKITEM.cell().With({isCR: TRUE, name: name, linebreak: TRUE}));
this.Push(STACKITEM.cell().With({isCR: true, name: name, linebreak: true}));
var top = this.stack.Top();
if (top.isa(STACKITEM.array)) {
if (n && top.arraydef.rowspacing) {
@ -1597,9 +1597,9 @@
}
if (open) {array.open = this.convertDelimiter(open)}
if (close) {array.close = this.convertDelimiter(close)}
if (style === "D") {array.arraydef.displaystyle = TRUE}
if (style === "D") {array.arraydef.displaystyle = true}
if (style === "S") {array.arraydef.scriptlevel = 1} // FIXME: should use mstyle?
if (raggedHeight) {array.arraydef.useHeight = FALSE}
if (raggedHeight) {array.arraydef.useHeight = false}
this.Push(begin);
return array;
},
@ -1784,7 +1784,7 @@
* @@@ FIXME: pass environment to TEX.Parse? @@@
*/
InternalMath: function (text,level) {
var def = {displaystyle: FALSE}; if (level != null) {def.scriptlevel = level}
var def = {displaystyle: false}; if (level != null) {def.scriptlevel = level}
if (this.stack.env.font) {def.mathvariant = this.stack.env.font}
if (!text.match(/\$|\\\(|\\(eq)?ref\s*\{/)) {return [this.InternalText(text,def)]}
var i = 0, k = 0, c, match = '';
@ -1931,7 +1931,7 @@
// Produce an error and stop processing this equation
//
Error: function (message) {
throw HUB.Insert(Error(message),{texError: TRUE});
throw HUB.Insert(Error(message),{texError: true});
},
//