Skip to content

Commit 53374cd

Browse files
add support for ' comments
1 parent 27ca057 commit 53374cd

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

os/programs/init.rrbasic

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
GLOBAL LIB$ = "/programs/libraries"
1+
GLOBAL LIB$ = "/programs/libraries" ' Default library path
22

33
PRINT "Mounting ";
44
COLOR 14
55
PRINT "filesystems";
66
COLOR 7
77
PRINT "..."
88

9-
MOUNT "/devices", "", "devfs"
9+
MOUNT "/devices", "", "devfs" ' Mount filesystems
1010
MOUNT "/boot", "hd0", "fat32"
11-
REM MOUNT "/harddisk", "hd0", "rfs"
1211

1312
KEYMAP "qemu"
1413

src/basic/main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,11 @@ char* clean_basic(const char* program, char* output_buffer)
5454
bracket_depth++;
5555
} else if (*p == ')' && !in_quotes) {
5656
bracket_depth--;
57+
} else if (*p == '\'' && bracket_depth == 0 && !in_quotes) {
58+
/* If we see ' then skip it and anything after it to the end of the line or end of program */
59+
while (*p && *p != '\r' && *p != '\n') {
60+
p++;
61+
}
5762
}
5863
if (!in_quotes && bracket_depth > 0) {
5964
if (*p != ' ') {

0 commit comments

Comments
 (0)