diff --git a/Units/parser-basic.r/basic-labels.d/expected.tags b/Units/parser-basic.r/basic-labels.d/expected.tags new file mode 100644 index 0000000000..ab91c61e79 --- /dev/null +++ b/Units/parser-basic.r/basic-labels.d/expected.tags @@ -0,0 +1 @@ +repeat input.bas /^repeat:$/;" l diff --git a/Units/parser-basic.r/basic-labels.d/input.bas b/Units/parser-basic.r/basic-labels.d/input.bas new file mode 100644 index 0000000000..3e16aeb1c5 --- /dev/null +++ b/Units/parser-basic.r/basic-labels.d/input.bas @@ -0,0 +1,7 @@ +' This is not a label: +REM This is not a label: + +repeat: +PRINT "Going 'round again" +GOTO repeat +END diff --git a/Units/review-needed.r/simple.bas.t/expected.tags b/Units/parser-basic.r/simple.bas.d/expected.tags similarity index 100% rename from Units/review-needed.r/simple.bas.t/expected.tags rename to Units/parser-basic.r/simple.bas.d/expected.tags diff --git a/Units/review-needed.r/simple.bas.t/input.bas b/Units/parser-basic.r/simple.bas.d/input.bas similarity index 100% rename from Units/review-needed.r/simple.bas.t/input.bas rename to Units/parser-basic.r/simple.bas.d/input.bas diff --git a/Units/review-needed.r/simple.bb.t/expected.tags b/Units/parser-basic.r/simple.bb.d/expected.tags similarity index 100% rename from Units/review-needed.r/simple.bb.t/expected.tags rename to Units/parser-basic.r/simple.bb.d/expected.tags diff --git a/Units/review-needed.r/simple.bb.t/input.bb b/Units/parser-basic.r/simple.bb.d/input.bb similarity index 100% rename from Units/review-needed.r/simple.bb.t/input.bb rename to Units/parser-basic.r/simple.bb.d/input.bb diff --git a/parsers/basic.c b/parsers/basic.c index 493b58a7f7..4a6cffa687 100644 --- a/parsers/basic.c +++ b/parsers/basic.c @@ -173,6 +173,15 @@ static void findBasicTags (void) if (!*p) continue; + /* REM comment? */ + if (strncasecmp (p, "REM", 3) == 0 && + (isspace (*(p + 3)) || *(p + 3) == '\0')) + continue; + + /* Single-quote comment? */ + if (*p == '\'') + continue; + /* In Basic, keywords always are at the start of the line. */ for (kw = keywords; kw->token; kw++) if (match_keyword (p, kw)) break; @@ -187,7 +196,7 @@ static void findBasicTags (void) parserDefinition *BasicParser (void) { - static char const *extensions[] = { "bas", "bi", "bb", "pb", NULL }; + static char const *extensions[] = { "bas", "bi", "bm", "bb", "pb", NULL }; parserDefinition *def = parserNew ("Basic"); def->kindTable = BasicKinds; def->kindCount = ARRAY_SIZE (BasicKinds);