mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
parser: check (mut f Foo)
syntax
This commit is contained in:
parent
b138cadbcb
commit
7f4cf08516
87 changed files with 492 additions and 480 deletions
|
@ -19,18 +19,18 @@ pub fn new_builder(initial_size int) Builder {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn (b mut Builder) write_b(data byte) {
|
||||
pub fn (mut b Builder) write_b(data byte) {
|
||||
b.buf << data
|
||||
b.len++
|
||||
}
|
||||
|
||||
pub fn (b mut Builder) write(s string) {
|
||||
pub fn (mut b Builder) write(s string) {
|
||||
b.buf.push_many(s.str, s.len)
|
||||
//b.buf << []byte(s) // TODO
|
||||
b.len += s.len
|
||||
}
|
||||
|
||||
pub fn (b mut Builder) writeln(s string) {
|
||||
pub fn (mut b Builder) writeln(s string) {
|
||||
b.buf.push_many(s.str, s.len)
|
||||
//b.buf << []byte(s) // TODO
|
||||
b.buf << `\n`
|
||||
|
@ -41,11 +41,11 @@ pub fn (b Builder) str() string {
|
|||
return string(b.buf, b.len)
|
||||
}
|
||||
|
||||
pub fn (b mut Builder) cut(n int) {
|
||||
pub fn (mut b Builder) cut(n int) {
|
||||
b.len -= n
|
||||
}
|
||||
|
||||
pub fn (b mut Builder) free() {
|
||||
pub fn (mut b Builder) free() {
|
||||
b.buf = make(0, b.initial_size, 1)
|
||||
b.len = 0
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue