Fix opcodes in comment in generate-bytecode.js

redux
David Majda 12 years ago
parent c7481d4da1
commit f985bd76ed

@ -41,18 +41,18 @@ var utils = require("../../utils"),
* currPos = stack.pop(); * currPos = stack.pop();
* stack.push(value); * stack.push(value);
* *
* [8] APPEND * [7] APPEND
* *
* value = stack.pop(); * value = stack.pop();
* array = stack.pop(); * array = stack.pop();
* array.push(value); * array.push(value);
* stack.push(array); * stack.push(array);
* *
* [9] WRAP n * [8] WRAP n
* *
* stack.push(stack.pop(n)); * stack.push(stack.pop(n));
* *
* [10] TEXT * [9] TEXT
* *
* stack.pop(); * stack.pop();
* stack.push(input.substring(stack.top(), currPos)); * stack.push(input.substring(stack.top(), currPos));
@ -60,7 +60,7 @@ var utils = require("../../utils"),
* Conditions and Loops * Conditions and Loops
* -------------------- * --------------------
* *
* [11] IF t, f * [10] IF t, f
* *
* if (stack.top()) { * if (stack.top()) {
* interpret(ip + 3, ip + 3 + t); * interpret(ip + 3, ip + 3 + t);
@ -68,7 +68,7 @@ var utils = require("../../utils"),
* interpret(ip + 3 + t, ip + 3 + t + f); * interpret(ip + 3 + t, ip + 3 + t + f);
* } * }
* *
* [12] IF_ERROR t, f * [11] IF_ERROR t, f
* *
* if (stack.top() === null) { * if (stack.top() === null) {
* interpret(ip + 3, ip + 3 + t); * interpret(ip + 3, ip + 3 + t);
@ -76,7 +76,7 @@ var utils = require("../../utils"),
* interpret(ip + 3 + t, ip + 3 + t + f); * interpret(ip + 3 + t, ip + 3 + t + f);
* } * }
* *
* [13] IF_NOT_ERROR t, f * [12] IF_NOT_ERROR t, f
* *
* if (stack.top() !== null) { * if (stack.top() !== null) {
* interpret(ip + 3, ip + 3 + t); * interpret(ip + 3, ip + 3 + t);
@ -84,7 +84,7 @@ var utils = require("../../utils"),
* interpret(ip + 3 + t, ip + 3 + t + f); * interpret(ip + 3 + t, ip + 3 + t + f);
* } * }
* *
* [14] WHILE_NOT_ERROR b * [13] WHILE_NOT_ERROR b
* *
* while(stack.top() !== null) { * while(stack.top() !== null) {
* interpret(ip + 2, ip + 2 + b); * interpret(ip + 2, ip + 2 + b);
@ -93,7 +93,7 @@ var utils = require("../../utils"),
* Matching * Matching
* -------- * --------
* *
* [15] MATCH_ANY a, f, ... * [14] MATCH_ANY a, f, ...
* *
* if (input.length > currPos) { * if (input.length > currPos) {
* interpret(ip + 3, ip + 3 + a); * interpret(ip + 3, ip + 3 + a);
@ -101,7 +101,7 @@ var utils = require("../../utils"),
* interpret(ip + 3 + a, ip + 3 + a + f); * interpret(ip + 3 + a, ip + 3 + a + f);
* } * }
* *
* [16] MATCH_STRING s, a, f, ... * [15] MATCH_STRING s, a, f, ...
* *
* if (input.substr(currPos, consts[s].length) === consts[s]) { * if (input.substr(currPos, consts[s].length) === consts[s]) {
* interpret(ip + 4, ip + 4 + a); * interpret(ip + 4, ip + 4 + a);
@ -109,7 +109,7 @@ var utils = require("../../utils"),
* interpret(ip + 4 + a, ip + 4 + a + f); * interpret(ip + 4 + a, ip + 4 + a + f);
* } * }
* *
* [17] MATCH_STRING_IC s, a, f, ... * [16] MATCH_STRING_IC s, a, f, ...
* *
* if (input.substr(currPos, consts[s].length).toLowerCase() === consts[s]) { * if (input.substr(currPos, consts[s].length).toLowerCase() === consts[s]) {
* interpret(ip + 4, ip + 4 + a); * interpret(ip + 4, ip + 4 + a);
@ -117,7 +117,7 @@ var utils = require("../../utils"),
* interpret(ip + 4 + a, ip + 4 + a + f); * interpret(ip + 4 + a, ip + 4 + a + f);
* } * }
* *
* [18] MATCH_REGEXP r, a, f, ... * [17] MATCH_REGEXP r, a, f, ...
* *
* if (consts[r].test(input.charAt(currPos))) { * if (consts[r].test(input.charAt(currPos))) {
* interpret(ip + 4, ip + 4 + a); * interpret(ip + 4, ip + 4 + a);
@ -125,17 +125,17 @@ var utils = require("../../utils"),
* interpret(ip + 4 + a, ip + 4 + a + f); * interpret(ip + 4 + a, ip + 4 + a + f);
* } * }
* *
* [19] ACCEPT_N n * [18] ACCEPT_N n
* *
* stack.push(input.substring(currPos, n)); * stack.push(input.substring(currPos, n));
* currPos += n; * currPos += n;
* *
* [20] ACCEPT_STRING s * [19] ACCEPT_STRING s
* *
* stack.push(consts[s]); * stack.push(consts[s]);
* currPos += consts[s].length; * currPos += consts[s].length;
* *
* [21] FAIL e * [20] FAIL e
* *
* stack.push(null); * stack.push(null);
* fail(consts[e]); * fail(consts[e]);
@ -143,15 +143,15 @@ var utils = require("../../utils"),
* Calls * Calls
* ----- * -----
* *
* [22] REPORT_SAVED_POS p * [21] REPORT_SAVED_POS p
* *
* reportedPos = stack[p]; * reportedPos = stack[p];
* *
* [23] REPORT_CURR_POS * [22] REPORT_CURR_POS
* *
* reportedPos = currPos; * reportedPos = currPos;
* *
* [25] CALL f, n, pc, p1, p2, ..., pN * [23] CALL f, n, pc, p1, p2, ..., pN
* *
* value = consts[f](stack[p1], ..., stack[pN]); * value = consts[f](stack[p1], ..., stack[pN]);
* stack.pop(n); * stack.pop(n);
@ -160,18 +160,18 @@ var utils = require("../../utils"),
* Rules * Rules
* ----- * -----
* *
* [26] RULE r * [24] RULE r
* *
* stack.push(parseRule(r)); * stack.push(parseRule(r));
* *
* Failure Reporting * Failure Reporting
* ----------------- * -----------------
* *
* [27] SILENT_FAILS_ON * [25] SILENT_FAILS_ON
* *
* silentFails++; * silentFails++;
* *
* [28] SILENT_FAILS_OFF * [26] SILENT_FAILS_OFF
* *
* silentFails--; * silentFails--;
*/ */

Loading…
Cancel
Save