checker: improve pub struct check (fix #14446) (#14777)

master
yuyi 2022-06-19 22:42:22 +08:00 committed by GitHub
parent 37ef1ee453
commit de136f6baf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 115 additions and 95 deletions

View File

@ -42,7 +42,7 @@ fn (mut l Layer) populate(nb_neurons int, nb_inputs int) {
} }
} }
struct Network { pub struct Network {
mut: mut:
layers []Layer layers []Layer
} }

View File

@ -1,7 +1,7 @@
module io module io
// BufferedReader provides a buffered interface for a reader // BufferedReader provides a buffered interface for a reader
struct BufferedReader { pub struct BufferedReader {
mut: mut:
reader Reader reader Reader
buf []u8 buf []u8

View File

@ -8,7 +8,7 @@ module json
#include "cJSON.h" #include "cJSON.h"
#define js_get(object, key) cJSON_GetObjectItemCaseSensitive((object), (key)) #define js_get(object, key) cJSON_GetObjectItemCaseSensitive((object), (key))
struct C.cJSON { pub struct C.cJSON {
valueint int valueint int
valuedouble f64 valuedouble f64
valuestring &char valuestring &char

View File

@ -2,7 +2,7 @@ module net
const max_unix_path = 108 const max_unix_path = 108
struct C.addrinfo { pub struct C.addrinfo {
mut: mut:
ai_family int ai_family int
ai_socktype int ai_socktype int
@ -14,28 +14,28 @@ mut:
ai_next voidptr ai_next voidptr
} }
struct C.sockaddr_in { pub struct C.sockaddr_in {
mut: mut:
sin_family u16 sin_family u16
sin_port u16 sin_port u16
sin_addr u32 sin_addr u32
} }
struct C.sockaddr_in6 { pub struct C.sockaddr_in6 {
mut: mut:
sin6_family u16 sin6_family u16
sin6_port u16 sin6_port u16
sin6_addr [4]u32 sin6_addr [4]u32
} }
struct C.sockaddr_un { pub struct C.sockaddr_un {
mut: mut:
sun_family u16 sun_family u16
sun_path [max_unix_path]char sun_path [max_unix_path]char
} }
[_pack: '1'] [_pack: '1']
struct Ip6 { pub struct Ip6 {
port u16 port u16
flow_info u32 flow_info u32
addr [16]u8 addr [16]u8
@ -43,7 +43,7 @@ struct Ip6 {
} }
[_pack: '1'] [_pack: '1']
struct Ip { pub struct Ip {
port u16 port u16
addr [4]u8 addr [4]u8
// Pad to size so that socket functions // Pad to size so that socket functions
@ -54,12 +54,12 @@ struct Ip {
sin_pad [8]u8 sin_pad [8]u8
} }
struct Unix { pub struct Unix {
path [max_unix_path]u8 path [max_unix_path]u8
} }
[_pack: '1'] [_pack: '1']
struct Addr { pub struct Addr {
pub: pub:
f u16 f u16
addr AddrData addr AddrData

View File

@ -2,7 +2,7 @@ module net
const max_unix_path = 104 const max_unix_path = 104
struct C.addrinfo { pub struct C.addrinfo {
mut: mut:
ai_family int ai_family int
ai_socktype int ai_socktype int
@ -14,7 +14,7 @@ mut:
ai_next voidptr ai_next voidptr
} }
struct C.sockaddr_in6 { pub struct C.sockaddr_in6 {
mut: mut:
// 1 + 1 + 2 + 4 + 16 + 4 = 28; // 1 + 1 + 2 + 4 + 16 + 4 = 28;
sin6_len u8 // 1 sin6_len u8 // 1
@ -25,7 +25,7 @@ mut:
sin6_scope_id u32 // 4 sin6_scope_id u32 // 4
} }
struct C.sockaddr_in { pub struct C.sockaddr_in {
mut: mut:
sin_len u8 sin_len u8
sin_family u8 sin_family u8
@ -34,7 +34,7 @@ mut:
sin_zero [8]char sin_zero [8]char
} }
struct C.sockaddr_un { pub struct C.sockaddr_un {
mut: mut:
sun_len u8 sun_len u8
sun_family u8 sun_family u8
@ -42,7 +42,7 @@ mut:
} }
[_pack: '1'] [_pack: '1']
struct Ip6 { pub struct Ip6 {
port u16 port u16
flow_info u32 flow_info u32
addr [16]u8 addr [16]u8
@ -50,7 +50,7 @@ struct Ip6 {
} }
[_pack: '1'] [_pack: '1']
struct Ip { pub struct Ip {
port u16 port u16
addr [4]u8 addr [4]u8
// Pad to size so that socket functions // Pad to size so that socket functions
@ -61,12 +61,12 @@ struct Ip {
sin_pad [8]u8 sin_pad [8]u8
} }
struct Unix { pub struct Unix {
path [max_unix_path]char path [max_unix_path]char
} }
[_pack: '1'] [_pack: '1']
struct Addr { pub struct Addr {
pub: pub:
len u8 len u8
f u8 f u8

View File

@ -2,7 +2,7 @@ module net
const max_unix_path = 104 const max_unix_path = 104
struct C.addrinfo { pub struct C.addrinfo {
mut: mut:
ai_family int ai_family int
ai_socktype int ai_socktype int
@ -14,21 +14,21 @@ mut:
ai_next voidptr ai_next voidptr
} }
struct C.sockaddr_in { pub struct C.sockaddr_in {
mut: mut:
sin_family u8 sin_family u8
sin_port u16 sin_port u16
sin_addr u32 sin_addr u32
} }
struct C.sockaddr_in6 { pub struct C.sockaddr_in6 {
mut: mut:
sin6_family u8 sin6_family u8
sin6_port u16 sin6_port u16
sin6_addr [4]u32 sin6_addr [4]u32
} }
struct C.sockaddr_un { pub struct C.sockaddr_un {
mut: mut:
sun_family u8 sun_family u8
sun_path [max_unix_path]char sun_path [max_unix_path]char

View File

@ -7,7 +7,7 @@ module net
const max_unix_path = 104 const max_unix_path = 104
struct C.addrinfo { pub struct C.addrinfo {
mut: mut:
ai_family int ai_family int
ai_socktype int ai_socktype int
@ -19,7 +19,7 @@ mut:
ai_next voidptr ai_next voidptr
} }
struct C.sockaddr_in6 { pub struct C.sockaddr_in6 {
mut: mut:
// 1 + 1 + 2 + 4 + 16 + 4 = 28; // 1 + 1 + 2 + 4 + 16 + 4 = 28;
sin6_len u8 // 1 sin6_len u8 // 1
@ -30,7 +30,7 @@ mut:
sin6_scope_id u32 // 4 sin6_scope_id u32 // 4
} }
struct C.sockaddr_in { pub struct C.sockaddr_in {
mut: mut:
sin_len u8 sin_len u8
sin_family u8 sin_family u8
@ -39,7 +39,7 @@ mut:
sin_zero [8]char sin_zero [8]char
} }
struct C.sockaddr_un { pub struct C.sockaddr_un {
mut: mut:
sun_len u8 sun_len u8
sun_family u8 sun_family u8
@ -47,7 +47,7 @@ mut:
} }
[_pack: '1'] [_pack: '1']
struct Ip6 { pub struct Ip6 {
port u16 port u16
flow_info u32 flow_info u32
addr [16]u8 addr [16]u8
@ -55,7 +55,7 @@ struct Ip6 {
} }
[_pack: '1'] [_pack: '1']
struct Ip { pub struct Ip {
port u16 port u16
addr [4]u8 addr [4]u8
// Pad to size so that socket functions // Pad to size so that socket functions
@ -66,12 +66,12 @@ struct Ip {
sin_pad [8]u8 sin_pad [8]u8
} }
struct Unix { pub struct Unix {
path [max_unix_path]char path [max_unix_path]char
} }
[_pack: '1'] [_pack: '1']
struct Addr { pub struct Addr {
pub: pub:
len u8 len u8
f u8 f u8

View File

@ -5,7 +5,7 @@ module net
const max_unix_path = 104 const max_unix_path = 104
struct C.addrinfo { pub struct C.addrinfo {
mut: mut:
ai_family int ai_family int
ai_socktype int ai_socktype int
@ -17,7 +17,7 @@ mut:
ai_next voidptr ai_next voidptr
} }
struct C.sockaddr_in6 { pub struct C.sockaddr_in6 {
mut: mut:
// 1 + 1 + 2 + 4 + 16 + 4 = 28; // 1 + 1 + 2 + 4 + 16 + 4 = 28;
sin6_len u8 // 1 sin6_len u8 // 1
@ -28,7 +28,7 @@ mut:
sin6_scope_id u32 // 4 sin6_scope_id u32 // 4
} }
struct C.sockaddr_in { pub struct C.sockaddr_in {
mut: mut:
sin_len u8 sin_len u8
sin_family u8 sin_family u8
@ -37,7 +37,7 @@ mut:
sin_zero [8]char sin_zero [8]char
} }
struct C.sockaddr_un { pub struct C.sockaddr_un {
mut: mut:
sun_len u8 sun_len u8
sun_family u8 sun_family u8
@ -45,7 +45,7 @@ mut:
} }
[_pack: '1'] [_pack: '1']
struct Ip6 { pub struct Ip6 {
port u16 port u16
flow_info u32 flow_info u32
addr [16]u8 addr [16]u8
@ -53,7 +53,7 @@ struct Ip6 {
} }
[_pack: '1'] [_pack: '1']
struct Ip { pub struct Ip {
port u16 port u16
addr [4]u8 addr [4]u8
// Pad to size so that socket functions // Pad to size so that socket functions
@ -64,12 +64,12 @@ struct Ip {
sin_pad [8]u8 sin_pad [8]u8
} }
struct Unix { pub struct Unix {
path [max_unix_path]char path [max_unix_path]char
} }
[_pack: '1'] [_pack: '1']
struct Addr { pub struct Addr {
pub: pub:
len u8 len u8
f u8 f u8

View File

@ -2,7 +2,7 @@ module net
const max_unix_path = 108 const max_unix_path = 108
struct C.addrinfo { pub struct C.addrinfo {
mut: mut:
ai_family int ai_family int
ai_socktype int ai_socktype int
@ -14,28 +14,28 @@ mut:
ai_next voidptr ai_next voidptr
} }
struct C.sockaddr_in { pub struct C.sockaddr_in {
mut: mut:
sin_family u16 sin_family u16
sin_port u16 sin_port u16
sin_addr u32 sin_addr u32
} }
struct C.sockaddr_in6 { pub struct C.sockaddr_in6 {
mut: mut:
sin6_family u16 sin6_family u16
sin6_port u16 sin6_port u16
sin6_addr [4]u32 sin6_addr [4]u32
} }
struct C.sockaddr_un { pub struct C.sockaddr_un {
mut: mut:
sun_family u16 sun_family u16
sun_path [max_unix_path]char sun_path [max_unix_path]char
} }
[_pack: '1'] [_pack: '1']
struct Ip6 { pub struct Ip6 {
port u16 port u16
flow_info u32 flow_info u32
addr [16]u8 addr [16]u8
@ -43,7 +43,7 @@ struct Ip6 {
} }
[_pack: '1'] [_pack: '1']
struct Ip { pub struct Ip {
port u16 port u16
addr [4]u8 addr [4]u8
// Pad to size so that socket functions // Pad to size so that socket functions
@ -54,12 +54,12 @@ struct Ip {
sin_pad [8]u8 sin_pad [8]u8
} }
struct Unix { pub struct Unix {
path [max_unix_path]u8 path [max_unix_path]u8
} }
[_pack: '1'] [_pack: '1']
struct Addr { pub struct Addr {
pub: pub:
f u16 f u16
addr AddrData addr AddrData

View File

@ -7,7 +7,7 @@ module net
const max_unix_path = 104 const max_unix_path = 104
struct C.addrinfo { pub struct C.addrinfo {
mut: mut:
ai_family int ai_family int
ai_socktype int ai_socktype int
@ -19,7 +19,7 @@ mut:
ai_next voidptr ai_next voidptr
} }
struct C.sockaddr_in6 { pub struct C.sockaddr_in6 {
mut: mut:
// 1 + 1 + 2 + 4 + 16 + 4 = 28; // 1 + 1 + 2 + 4 + 16 + 4 = 28;
sin6_len u8 // 1 sin6_len u8 // 1
@ -30,7 +30,7 @@ mut:
sin6_scope_id u32 // 4 sin6_scope_id u32 // 4
} }
struct C.sockaddr_in { pub struct C.sockaddr_in {
mut: mut:
sin_len u8 sin_len u8
sin_family u8 sin_family u8
@ -39,7 +39,7 @@ mut:
sin_zero [8]char sin_zero [8]char
} }
struct C.sockaddr_un { pub struct C.sockaddr_un {
mut: mut:
sun_len u8 sun_len u8
sun_family u8 sun_family u8
@ -47,7 +47,7 @@ mut:
} }
[_pack: '1'] [_pack: '1']
struct Ip6 { pub struct Ip6 {
port u16 port u16
flow_info u32 flow_info u32
addr [16]u8 addr [16]u8
@ -55,7 +55,7 @@ struct Ip6 {
} }
[_pack: '1'] [_pack: '1']
struct Ip { pub struct Ip {
port u16 port u16
addr [4]u8 addr [4]u8
// Pad to size so that socket functions // Pad to size so that socket functions
@ -66,12 +66,12 @@ struct Ip {
sin_pad [8]u8 sin_pad [8]u8
} }
struct Unix { pub struct Unix {
path [max_unix_path]char path [max_unix_path]char
} }
[_pack: '1'] [_pack: '1']
struct Addr { pub struct Addr {
pub: pub:
len u8 len u8
f u8 f u8

View File

@ -5,7 +5,7 @@ module net
const max_unix_path = 104 const max_unix_path = 104
struct C.addrinfo { pub struct C.addrinfo {
mut: mut:
ai_family int ai_family int
ai_socktype int ai_socktype int
@ -17,7 +17,7 @@ mut:
ai_next voidptr ai_next voidptr
} }
struct C.sockaddr_in6 { pub struct C.sockaddr_in6 {
mut: mut:
// 1 + 1 + 2 + 4 + 16 + 4 = 28; // 1 + 1 + 2 + 4 + 16 + 4 = 28;
sin6_len u8 // 1 sin6_len u8 // 1
@ -28,7 +28,7 @@ mut:
sin6_scope_id u32 // 4 sin6_scope_id u32 // 4
} }
struct C.sockaddr_in { pub struct C.sockaddr_in {
mut: mut:
sin_len u8 sin_len u8
sin_family u8 sin_family u8
@ -37,7 +37,7 @@ mut:
sin_zero [8]char sin_zero [8]char
} }
struct C.sockaddr_un { pub struct C.sockaddr_un {
mut: mut:
sun_len u8 sun_len u8
sun_family u8 sun_family u8
@ -45,7 +45,7 @@ mut:
} }
[_pack: '1'] [_pack: '1']
struct Ip6 { pub struct Ip6 {
port u16 port u16
flow_info u32 flow_info u32
addr [16]u8 addr [16]u8
@ -53,7 +53,7 @@ struct Ip6 {
} }
[_pack: '1'] [_pack: '1']
struct Ip { pub struct Ip {
port u16 port u16
addr [4]u8 addr [4]u8
// Pad to size so that socket functions // Pad to size so that socket functions
@ -64,12 +64,12 @@ struct Ip {
sin_pad [8]u8 sin_pad [8]u8
} }
struct Unix { pub struct Unix {
path [max_unix_path]char path [max_unix_path]char
} }
[_pack: '1'] [_pack: '1']
struct Addr { pub struct Addr {
pub: pub:
len u8 len u8
f u8 f u8

View File

@ -2,7 +2,7 @@ module net
const max_unix_path = 108 const max_unix_path = 108
struct C.addrinfo { pub struct C.addrinfo {
mut: mut:
ai_family int ai_family int
ai_socktype int ai_socktype int
@ -14,28 +14,28 @@ mut:
ai_next voidptr ai_next voidptr
} }
struct C.sockaddr_in { pub struct C.sockaddr_in {
mut: mut:
sin_family u16 sin_family u16
sin_port u16 sin_port u16
sin_addr u32 sin_addr u32
} }
struct C.sockaddr_in6 { pub struct C.sockaddr_in6 {
mut: mut:
sin6_family u16 sin6_family u16
sin6_port u16 sin6_port u16
sin6_addr [4]u32 sin6_addr [4]u32
} }
struct C.sockaddr_un { pub struct C.sockaddr_un {
mut: mut:
sun_family u16 sun_family u16
sun_path [max_unix_path]char sun_path [max_unix_path]char
} }
[_pack: '1'] [_pack: '1']
struct Ip6 { pub struct Ip6 {
port u16 port u16
flow_info u32 flow_info u32
addr [16]u8 addr [16]u8
@ -43,18 +43,18 @@ struct Ip6 {
} }
[_pack: '1'] [_pack: '1']
struct Ip { pub struct Ip {
port u16 port u16
addr [4]u8 addr [4]u8
sin_pad [8]u8 sin_pad [8]u8
} }
struct Unix { pub struct Unix {
path [max_unix_path]u8 path [max_unix_path]u8
} }
[_pack: '1'] [_pack: '1']
struct Addr { pub struct Addr {
pub: pub:
f u16 f u16
addr AddrData addr AddrData

View File

@ -11,14 +11,14 @@ const (
msg_nosignal = 0x4000 msg_nosignal = 0x4000
) )
struct StreamSocket { pub struct StreamSocket {
pub: pub:
handle int handle int
mut: mut:
path string path string
} }
struct StreamConn { pub struct StreamConn {
pub mut: pub mut:
sock StreamSocket sock StreamSocket
mut: mut:
@ -28,7 +28,7 @@ mut:
write_timeout time.Duration write_timeout time.Duration
} }
struct StreamListener { pub struct StreamListener {
pub mut: pub mut:
sock StreamSocket sock StreamSocket
mut: mut:

View File

@ -25,7 +25,7 @@ pub mut:
} }
// ServerClient represents a connected client // ServerClient represents a connected client
struct ServerClient { pub struct ServerClient {
pub: pub:
resource_name string // resource that the client access resource_name string // resource that the client access
client_key string // unique key of client client_key string // unique key of client

View File

@ -1,6 +1,6 @@
module os module os
struct C.stat { pub struct C.stat {
st_size u64 st_size u64
st_mode u32 st_mode u32
st_mtime int st_mtime int

View File

@ -1,6 +1,6 @@
module os module os
struct C.stat { pub struct C.stat {
st_dev u64 // 8 st_dev u64 // 8
st_ino u64 // 8 st_ino u64 // 8
st_nlink u64 // 8 st_nlink u64 // 8

View File

@ -16,7 +16,7 @@ import os
const cclen = 10 const cclen = 10
// Termios stores the terminal options on Linux. // Termios stores the terminal options on Linux.
struct C.termios { pub struct C.termios {
mut: mut:
c_iflag int c_iflag int
c_oflag int c_oflag int

View File

@ -31,7 +31,7 @@ enum Direction {
push push
} }
struct Channel { pub struct Channel {
ringbuf &u8 // queue for buffered channels ringbuf &u8 // queue for buffered channels
statusbuf &u8 // flags to synchronize write/read in ringbuf statusbuf &u8 // flags to synchronize write/read in ringbuf
objsize u32 objsize u32

View File

@ -54,7 +54,7 @@ MacOSX has no unnamed semaphores and no `timed_wait()` at all
so we emulate the behaviour with other devices so we emulate the behaviour with other devices
*/ */
[heap] [heap]
struct Semaphore { pub struct Semaphore {
mtx C.pthread_mutex_t mtx C.pthread_mutex_t
cond C.pthread_cond_t cond C.pthread_cond_t
mut: mut:

View File

@ -60,7 +60,7 @@ struct RwMutexAttr {
} }
[heap] [heap]
struct Semaphore { pub struct Semaphore {
sem C.sem_t sem C.sem_t
} }

View File

@ -38,7 +38,7 @@ mut:
} }
[heap] [heap]
struct Semaphore { pub struct Semaphore {
mtx C.SRWLOCK mtx C.SRWLOCK
cond C.CONDITION_VARIABLE cond C.CONDITION_VARIABLE
mut: mut:

View File

@ -25,7 +25,7 @@ fn C.atomic_compare_exchange_weak_u32(voidptr, voidptr, u32) bool
// //
// [init_with=new_waitgroup] // TODO: implement support for init_with struct attribute, and disallow WaitGroup{} from outside the sync.new_waitgroup() function. // [init_with=new_waitgroup] // TODO: implement support for init_with struct attribute, and disallow WaitGroup{} from outside the sync.new_waitgroup() function.
[heap] [heap]
struct WaitGroup { pub struct WaitGroup {
mut: mut:
task_count u32 // current task count - reading/writing should be atomic task_count u32 // current task count - reading/writing should be atomic
wait_count u32 // current wait count - reading/writing should be atomic wait_count u32 // current wait count - reading/writing should be atomic

View File

@ -3,14 +3,14 @@ module term
import os import os
[typedef] [typedef]
struct C.COORD { pub struct C.COORD {
mut: mut:
X i16 X i16
Y i16 Y i16
} }
[typedef] [typedef]
struct C.SMALL_RECT { pub struct C.SMALL_RECT {
mut: mut:
Left u16 Left u16
Top u16 Top u16
@ -21,7 +21,7 @@ mut:
// win: CONSOLE_SCREEN_BUFFER_INFO // win: CONSOLE_SCREEN_BUFFER_INFO
// https://docs.microsoft.com/en-us/windows/console/console-screen-buffer-info-str // https://docs.microsoft.com/en-us/windows/console/console-screen-buffer-info-str
[typedef] [typedef]
struct C.CONSOLE_SCREEN_BUFFER_INFO { pub struct C.CONSOLE_SCREEN_BUFFER_INFO {
mut: mut:
dwSize C.COORD dwSize C.COORD
dwCursorPosition C.COORD dwCursorPosition C.COORD
@ -30,14 +30,14 @@ mut:
dwMaximumWindowSize C.COORD dwMaximumWindowSize C.COORD
} }
union C.uChar { pub union C.uChar {
mut: mut:
UnicodeChar rune UnicodeChar rune
AsciiChar u8 AsciiChar u8
} }
[typedef] [typedef]
struct C.CHAR_INFO { pub struct C.CHAR_INFO {
mut: mut:
Char C.uChar Char C.uChar
Attributes u16 Attributes u16

View File

@ -1,6 +1,6 @@
module ui module ui
struct C.termios { pub struct C.termios {
mut: mut:
c_iflag int c_iflag int
c_oflag int c_oflag int

View File

@ -15,7 +15,7 @@ struct C.tm {
tm_sec int tm_sec int
} }
struct C._FILETIME { pub struct C._FILETIME {
dwLowDateTime u32 dwLowDateTime u32
dwHighDateTime u32 dwHighDateTime u32
} }

View File

@ -3724,6 +3724,10 @@ fn (mut c Checker) ensure_type_exists(typ ast.Type, pos token.Pos) ? {
return return
} }
sym := c.table.sym(typ) sym := c.table.sym(typ)
if !c.is_builtin_mod && sym.kind == .struct_ && sym.mod != c.mod && !sym.is_pub {
c.error('type `$sym.name` is private', pos)
return
}
match sym.kind { match sym.kind {
.placeholder { .placeholder {
if sym.language == .v && !sym.name.starts_with('C.') { if sym.language == .v && !sym.name.starts_with('C.') {

View File

@ -261,7 +261,7 @@ pub fn (mut c Checker) struct_init(mut node ast.StructInit) ast.Type {
&& c.table.cur_concrete_types.len == 0 { && c.table.cur_concrete_types.len == 0 {
pos := type_sym.name.last_index('.') or { -1 } pos := type_sym.name.last_index('.') or { -1 }
first_letter := type_sym.name[pos + 1] first_letter := type_sym.name[pos + 1]
if !first_letter.is_capital() { if !first_letter.is_capital() && type_sym.kind != .placeholder {
c.error('cannot initialize builtin type `$type_sym.name`', node.pos) c.error('cannot initialize builtin type `$type_sym.name`', node.pos)
} }
} }

View File

@ -0,0 +1,11 @@
vlib/v/checker/tests/struct_type_is_private_err.vv:1:8: warning: module 'sqlite' is imported but never used
1 | import sqlite
| ~~~~~~
2 |
3 | fn main(){
vlib/v/checker/tests/struct_type_is_private_err.vv:4:10: error: type `C.sqlite3` is private
2 |
3 | fn main(){
4 | _ := &C.sqlite3{}
| ~~~~~~~~~
5 | }

View File

@ -0,0 +1,5 @@
import sqlite
fn main(){
_ := &C.sqlite3{}
}

View File

@ -14,7 +14,7 @@ pub mut:
deps []string deps []string
} }
struct DepGraph { pub struct DepGraph {
pub mut: pub mut:
acyclic bool acyclic bool
nodes []DepGraphNode nodes []DepGraphNode

View File

@ -3,7 +3,7 @@ module dotgraph
import strings import strings
[heap] [heap]
struct DotGraph { pub struct DotGraph {
mut: mut:
sb strings.Builder sb strings.Builder
} }

View File

@ -10,7 +10,7 @@ const (
type SourceMapJson = map[string]json2.Any type SourceMapJson = map[string]json2.Any
struct SourceMap { pub struct SourceMap {
pub mut: pub mut:
version int [json: version] version int [json: version]
file string [json: file] file string [json: file]

View File

@ -10,7 +10,7 @@ const (
unknown_asset_type_error = 'vweb.assets: unknown asset type' unknown_asset_type_error = 'vweb.assets: unknown asset type'
) )
struct AssetManager { pub struct AssetManager {
mut: mut:
css []Asset css []Asset
js []Asset js []Asset