1
0
mirror of https://github.com/janet-lang/janet synced 2025-10-29 22:53:03 +00:00

Add shorthand package name support in jpm.

Package installation checks in the package listing if
the package name is not a url. The package listsing can be specified
via switch or env variable.
This commit is contained in:
Calvin Rose
2019-10-10 18:11:45 -05:00
parent f9d57103f4
commit 54b66a4199
3 changed files with 26 additions and 5 deletions

View File

@@ -887,10 +887,8 @@ static uint32_t peg_compile1(Builder *b, Janet peg) {
JanetTable *grammar = old_grammar;
for (; i > 0 && janet_checktype(peg, JANET_KEYWORD); --i) {
peg = janet_table_get_ex(grammar, peg, &grammar);
if (!grammar || janet_checktype(peg, JANET_NIL)) {
builder_cleanup(b);
janet_panicf("grammar error in %p, unknown rule", b->form);
}
if (!grammar || janet_checktype(peg, JANET_NIL))
peg_panic(b, "unkown rule");
b->form = peg;
b->grammar = grammar;
}