1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

parser: check (mut f Foo) syntax

This commit is contained in:
yuyi
2020-05-17 19:51:18 +08:00
committed by GitHub
parent b138cadbcb
commit 7f4cf08516
87 changed files with 492 additions and 480 deletions

View File

@@ -325,7 +325,7 @@ pub fn open_file(path string, mode string, options ...int) ?File {
}
}
pub fn (f mut File) write_bytes_at(data voidptr, size, pos int) {
pub fn (mut f File) write_bytes_at(data voidptr, size, pos int) {
//$if linux {
//}
//$else {
@@ -335,7 +335,7 @@ pub fn (f mut File) write_bytes_at(data voidptr, size, pos int) {
//}
}
pub fn (f mut File) flush() {
pub fn (mut f File) flush() {
if !f.opened {
return
}

View File

@@ -128,12 +128,12 @@ pub fn create(path string) ?File {
}
/*
pub fn (f mut File) fseek(pos, mode int) {
pub fn (mut f File) fseek(pos, mode int) {
}
*/
pub fn (f mut File) write(s string) {
pub fn (mut f File) write(s string) {
if !f.opened {
return
}
@@ -149,7 +149,7 @@ pub fn (f mut File) write(s string) {
// C.fwrite(s.str, 1, s.len, f.cfile)
}
pub fn (f mut File) writeln(s string) {
pub fn (mut f File) writeln(s string) {
if !f.opened {
return
}
@@ -237,7 +237,7 @@ pub fn get_error_msg(code int) string {
// convert any value to []byte (LittleEndian) and write it
// for example if we have write(7, 4), "07 00 00 00" gets written
// write(0x1234, 2) => "34 12"
pub fn (f mut File) write_bytes(data voidptr, size int) {
pub fn (mut f File) write_bytes(data voidptr, size int) {
/*
$if linux {
$if !android {
@@ -249,7 +249,7 @@ pub fn (f mut File) write_bytes(data voidptr, size int) {
C.fwrite(data, 1, size, f.cfile)
}
pub fn (f mut File) close() {
pub fn (mut f File) close() {
if !f.opened {
return
}

View File

@@ -155,14 +155,14 @@ pub fn create(path string) ?File {
return file
}
pub fn (f mut File) write(s string) {
pub fn (mut f File) write(s string) {
if !f.opened {
return
}
C.fputs(s.str, f.cfile)
}
pub fn (f mut File) writeln(s string) {
pub fn (mut f File) writeln(s string) {
if !f.opened {
return
}
@@ -344,11 +344,11 @@ pub fn symlink(origin, target string) ?bool {
return error(get_error_msg(int(C.GetLastError())))
}
pub fn (f mut File) write_bytes(data voidptr, size int) {
pub fn (mut f File) write_bytes(data voidptr, size int) {
C.fwrite(data, 1, size, f.cfile)
}
pub fn (f mut File) close() {
pub fn (mut f File) close() {
if !f.opened {
return
}