Skip to content

Commit

Permalink
better parser method that accept input string
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Dec 6, 2024
1 parent 8a95909 commit af6ad0a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 28 deletions.
16 changes: 8 additions & 8 deletions dist/lips.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions dist/lips.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions dist/lips.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions src/lips.js
Original file line number Diff line number Diff line change
Expand Up @@ -1521,7 +1521,7 @@ class Parser {
return result;
}, cleanup);
}
parse(arg) {
prepare(arg) {
if (arg instanceof LString) {
arg = arg.toString();
}
Expand Down Expand Up @@ -1867,7 +1867,7 @@ async function* _parse(arg, env) {
parser = arg;
} else {
parser = new Parser({ env });
parser.parse(arg);
parser.prepare(arg);
}
let prev;
while (true) {
Expand Down Expand Up @@ -7037,7 +7037,7 @@ function InputPort(read, env = global_env) {
if (!this.char_ready()) {
const line = await this._read();
parser = new Parser({ env });
parser.parse(line);
parser.prepare(line);
}
return this.__parser__;
});
Expand Down Expand Up @@ -7983,7 +7983,7 @@ const constants = {
...parsable_contants
};
// -------------------------------------------------------------------------
const global_env = new Environment({
var global_env = new Environment({
eof,
undefined, // undefined as parser constant breaks most of the unit tests
// ---------------------------------------------------------------------
Expand Down

0 comments on commit af6ad0a

Please sign in to comment.