Author: mesyeti <mesyeti@mesyeti.uk>
fix private
basic-std/std/file.bas | 16 ++++++++-------- basic-std/std/io.bas | 9 +++++++-- basic/source/parser.c | 2 +- basic/test.bas | 4 ++--
diff --git a/basic/source/parser.c b/basic/source/parser.c index f15b59aace8614f6b523e1fed08807c68800e203..d7a010a9be92d6adeabb30512dc7b46b1299149f 100644 --- a/basic/source/parser.c +++ b/basic/source/parser.c @@ -858,7 +858,7 @@ case TOKEN_CONST: ret = ParseConst(p); break; case TOKEN_PRIVATE: { p->private = true; Advance(p); - break; + return ParseNode(p); } case TOKEN_LPAREN: case TOKEN_ACCESS_XOR: diff --git a/basic/test.bas b/basic/test.bas index a7df0bb0c547a76c9436626fef9eed00a0bf16e6..8bc535d6d612b0c46305da9d3d2ae409e2ee3e61 100644 --- a/basic/test.bas +++ b/basic/test.bas @@ -2,8 +2,8 @@ 'NITRON program test -extern func puts(str as ptr(char)) i32 -extern func printf(str as ptr(char), val as int) i32 +private extern func puts(str as ptr(char)) i32 +private extern func printf(str as ptr(char), val as int) i32 const FOO_BAR = 5 diff --git a/basic-std/std/file.bas b/basic-std/std/file.bas index 4d552b12f6370a29c4777d8cf9ca50f8262acccc..0c8fe4aae59d0ac74276b32a6e3984d61822370f 100644 --- a/basic-std/std/file.bas +++ b/basic-std/std/file.bas @@ -4,7 +4,7 @@ private extern func fopen(path as ptr(char), mode as ptr(char)) ptr(unit) private extern func fclose(file as ptr(unit)) i32 private extern func fread(output as ptr(unit), size as uint, n as uint, file as ptr(unit)) uint private extern func ftell(file as ptr(unit)) int -private extern func fseek(file as ptr(unit), int offset, i32 whence) i32 +private extern func fseek(file as ptr(unit), offset as int, whence as i32) i32 const SEEK_SET = 0 const SEEK_CUR = 1 @@ -42,10 +42,10 @@ func File_Read(this as ptr(File), size as uint, output as ptr(unit)) uint return fread(output, 1, size, this.file) end -func File_Peek(this as ptr(File)) uint - return ftell(this.file) as uint -end - -func File_Seek(this as ptr(File), where as uint, offset as int) bool - return fseek(this.file, offset, where as i32) == 0 -end +'func File_Peek(this as ptr(File)) uint +'' return ftell(this.file) as uint +'end +'' +'func File_Seek(this as ptr(File), where as uint, offset as int) bool +'' return fseek(this.file, offset, where as i32) == 0 +'end diff --git a/basic-std/std/io.bas b/basic-std/std/io.bas index 957c8d97d4e893e5c31555c8646f129f0a0aea79..348483dcd3aca330a1dd08256ff562877f76a7d3 100644 --- a/basic-std/std/io.bas +++ b/basic-std/std/io.bas @@ -1,7 +1,8 @@ 'NITRON -extern func puts(str as ptr(char)) i32 -extern func putchar(ch as char) i32 +private extern func puts(str as ptr(char)) i32 +private extern func putchar(ch as char) i32 +private extern func printf(str as ptr(char), value as int) i32 sub PrintChar(ch as char) putchar(ch) @@ -21,3 +22,7 @@ sub NewLine() puts("") end + +sub PrintInt(value as int) + printf("%lld", value) +end