Annotation of loncom/html/adm/LC_math_editor/src/token.js, revision 1.2
1.1 damieng 1: /*
2:
3: Copyright (C) 2014 Michigan State University Board of Trustees
4:
5: The JavaScript code in this page is free software: you can
6: redistribute it and/or modify it under the terms of the GNU
7: General Public License (GNU GPL) as published by the Free Software
8: Foundation, either version 3 of the License, or (at your option)
9: any later version. The code is distributed WITHOUT ANY WARRANTY;
10: without even the implied warranty of MERCHANTABILITY or FITNESS
11: FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
12:
13: As additional permission under GNU GPL version 3 section 7, you
14: may distribute non-source (e.g., minimized or compacted) forms of
15: that code without the copy of the GNU GPL normally required by
16: section 4, provided you include this license notice and a URL
17: through which recipients can access the Corresponding Source.
18:
19: */
20:
1.2 ! damieng 21: "use strict";
! 22:
1.1 damieng 23: /**
24: * A token from the equation text.
25: * @constructor
26: * @param {number} type - Token type: Token.UNKNOWN, NAME, NUMBER, OPERATOR
27: * @param {number} from - Index of the token's first character
28: * @param {number} to - Index of the token's last character
29: * @param {string} value - String content of the token
30: * @param {Operator} op - The matching operator, possibly null
31: */
32: function Token(type, from, to, value, op) {
33: this.type = type;
34: this.from = from;
35: this.to = to;
36: this.value = value;
37: this.op = op;
38: }
39:
40: Token.UNKNOWN = 0;
41: Token.NAME = 1;
42: Token.NUMBER = 2;
43: Token.OPERATOR = 3;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>