aboutsummaryrefslogtreecommitdiff
path: root/parse.js
diff options
context:
space:
mode:
Diffstat (limited to 'parse.js')
-rw-r--r--parse.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/parse.js b/parse.js
index 819b3ed..7c47423 100644
--- a/parse.js
+++ b/parse.js
@@ -94,6 +94,8 @@ function getToLineStartingWith(s, ss, start = 0)
function findExpression(data, expr, start = 0)
{
+ if (start == -1)
+ return -1;
if (!(Number.isInteger(start) && (start >= 0)))
throw new TypeError("Start must be a positive integer!");
while ((data.substring(start, start + expr.length) !== expr) && (start + expr.length < data.length))
@@ -105,7 +107,7 @@ function findExpression(data, expr, start = 0)
function parseCluttered(s)
{
- return s.replaceAll(".", "").replaceAll(" ", "").toUpperCase();
+ return s.replaceAll(".", "").replaceAll(" ", "").replaceAll("<", "(").replaceAll(">", ")").toUpperCase();
}
function parseClasses(classData, DB)
@@ -280,3 +282,4 @@ exports.indexType = getIndexType;
exports.classes = parseClasses;
exports.get = getShift;
exports.cluttered = parseCluttered;
+exports.find = findExpression;