ast: fix const field str() (#22192)

This commit is contained in:
yuyi 2024-09-10 22:02:51 +08:00 committed by GitHub
parent 86fe9456a5
commit dd2210abf6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
16 changed files with 48 additions and 57 deletions

View File

@ -17,7 +17,7 @@ pub const max_headers = 50
pub struct Header { pub struct Header {
pub mut: pub mut:
// data map[string][]string // data map[string][]string
data [http.max_headers]HeaderKV data [max_headers]HeaderKV
mut: mut:
cur_pos int cur_pos int
// map of lowercase header keys to their original keys // map of lowercase header keys to their original keys

View File

@ -769,7 +769,7 @@ pub const sg_max_mipmaps = 16
pub struct C.sg_image_data { pub struct C.sg_image_data {
pub mut: pub mut:
subimage [gfx.sg_cubeface_num][gfx.sg_max_mipmaps]Range subimage [sg_cubeface_num][sg_max_mipmaps]Range
} }
pub type ImageData = C.sg_image_data pub type ImageData = C.sg_image_data

View File

@ -29,7 +29,7 @@ pub type ImageDesc = C.sapp_image_desc
pub struct C.sapp_icon_desc { pub struct C.sapp_icon_desc {
pub: pub:
sokol_default bool sokol_default bool
images [sapp.max_iconimages]ImageDesc images [max_iconimages]ImageDesc
} }
pub type IconDesc = C.sapp_icon_desc pub type IconDesc = C.sapp_icon_desc
@ -103,7 +103,7 @@ pub:
scroll_x f32 // horizontal mouse wheel scroll distance, valid in MOUSE_SCROLL events scroll_x f32 // horizontal mouse wheel scroll distance, valid in MOUSE_SCROLL events
scroll_y f32 // vertical mouse wheel scroll distance, valid in MOUSE_SCROLL events scroll_y f32 // vertical mouse wheel scroll distance, valid in MOUSE_SCROLL events
num_touches int // number of valid items in the touches[] array num_touches int // number of valid items in the touches[] array
touches [sapp.max_touchpoints]TouchPoint // current touch points, valid in TOUCHES_BEGIN, TOUCHES_MOVED, TOUCHES_ENDED touches [max_touchpoints]TouchPoint // current touch points, valid in TOUCHES_BEGIN, TOUCHES_MOVED, TOUCHES_ENDED
window_width int // current window- and framebuffer width in pixels, always valid window_width int // current window- and framebuffer width in pixels, always valid
window_height int // current window- and framebuffer height in pixels, always valid window_height int // current window- and framebuffer height in pixels, always valid
framebuffer_width int // = window_width * dpi_scale framebuffer_width int // = window_width * dpi_scale

View File

@ -26,7 +26,7 @@ mut:
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_line Cc c_line Cc
c_cc [termios.cclen]Cc c_cc [cclen]Cc
c_ispeed Speed c_ispeed Speed
c_ospeed Speed c_ospeed Speed
} }
@ -58,7 +58,7 @@ pub mut:
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_line Cc c_line Cc
c_cc [termios.cclen]Cc c_cc [cclen]Cc
c_ispeed Speed c_ispeed Speed
c_ospeed Speed c_ospeed Speed
} }

View File

@ -25,7 +25,7 @@ mut:
c_oflag TcFlag c_oflag TcFlag
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_cc [termios.cclen]Cc c_cc [cclen]Cc
c_ispeed Speed c_ispeed Speed
c_ospeed Speed c_ospeed Speed
} }
@ -56,7 +56,7 @@ pub mut:
c_oflag TcFlag c_oflag TcFlag
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_cc [termios.cclen]Cc c_cc [cclen]Cc
c_ispeed Speed c_ispeed Speed
c_ospeed Speed c_ospeed Speed
} }

View File

@ -25,7 +25,7 @@ mut:
c_oflag TcFlag c_oflag TcFlag
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_cc [termios.cclen]Cc c_cc [cclen]Cc
c_ispeed Speed c_ispeed Speed
c_ospeed Speed c_ospeed Speed
} }
@ -56,7 +56,7 @@ pub mut:
c_oflag TcFlag c_oflag TcFlag
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_cc [termios.cclen]Cc c_cc [cclen]Cc
c_ispeed Speed c_ispeed Speed
c_ospeed Speed c_ospeed Speed
} }

View File

@ -25,7 +25,7 @@ mut:
c_oflag TcFlag c_oflag TcFlag
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_cc [termios.cclen]Cc c_cc [cclen]Cc
c_ispeed Speed c_ispeed Speed
c_ospeed Speed c_ospeed Speed
} }
@ -56,7 +56,7 @@ pub mut:
c_oflag TcFlag c_oflag TcFlag
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_cc [termios.cclen]Cc c_cc [cclen]Cc
c_ispeed Speed c_ispeed Speed
c_ospeed Speed c_ospeed Speed
} }

View File

@ -26,7 +26,7 @@ mut:
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_line Cc c_line Cc
c_cc [termios.cclen]Cc c_cc [cclen]Cc
c_ispeed Speed c_ispeed Speed
c_ospeed Speed c_ospeed Speed
} }
@ -58,7 +58,7 @@ pub mut:
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_line Cc c_line Cc
c_cc [termios.cclen]Cc c_cc [cclen]Cc
c_ispeed Speed c_ispeed Speed
c_ospeed Speed c_ospeed Speed
} }

View File

@ -25,7 +25,7 @@ mut:
c_oflag TcFlag c_oflag TcFlag
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_cc [termios.cclen]Cc c_cc [cclen]Cc
c_ispeed Speed c_ispeed Speed
c_ospeed Speed c_ospeed Speed
} }
@ -56,7 +56,7 @@ pub mut:
c_oflag TcFlag c_oflag TcFlag
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_cc [termios.cclen]Cc c_cc [cclen]Cc
c_ispeed Speed c_ispeed Speed
c_ospeed Speed c_ospeed Speed
} }

View File

@ -25,7 +25,7 @@ mut:
c_oflag TcFlag c_oflag TcFlag
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_cc [termios.cclen]Cc c_cc [cclen]Cc
reserved [3]u32 reserved [3]u32
c_ispeed Speed c_ispeed Speed
c_ospeed Speed c_ospeed Speed
@ -57,7 +57,7 @@ pub mut:
c_oflag TcFlag c_oflag TcFlag
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_cc [termios.cclen]Cc c_cc [cclen]Cc
reserved [3]u32 reserved [3]u32
c_ispeed Speed c_ispeed Speed
c_ospeed Speed c_ospeed Speed

View File

@ -25,7 +25,7 @@ mut:
c_oflag TcFlag c_oflag TcFlag
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_cc [termios.cclen]Cc c_cc [cclen]Cc
} }
fn C.tcgetattr(fd int, termios_p &C.termios) int fn C.tcgetattr(fd int, termios_p &C.termios) int
@ -54,7 +54,7 @@ pub mut:
c_oflag TcFlag c_oflag TcFlag
c_cflag TcFlag c_cflag TcFlag
c_lflag TcFlag c_lflag TcFlag
c_cc [termios.cclen]Cc c_cc [cclen]Cc
} }
// tcgetattr is an unsafe wrapper around C.termios and keeps its semantic // tcgetattr is an unsafe wrapper around C.termios and keeps its semantic

View File

@ -17,7 +17,7 @@ struct ExtraContext {
mut: mut:
stdin_handle C.HANDLE stdin_handle C.HANDLE
stdout_handle C.HANDLE stdout_handle C.HANDLE
read_buf [ui.buf_size]C.INPUT_RECORD read_buf [buf_size]C.INPUT_RECORD
mouse_down MouseButton mouse_down MouseButton
} }

View File

@ -518,15 +518,6 @@ pub fn (x &Expr) str() string {
if x.cached_name != '' { if x.cached_name != '' {
return x.cached_name return x.cached_name
} }
if obj := x.scope.find('${x.mod}.${x.name}') {
if obj is ConstField && x.mod != 'main' {
last_mod := x.mod.all_after_last('.')
unsafe {
x.cached_name = '${last_mod}.${x.name}'
}
return x.cached_name
}
}
unsafe { unsafe {
x.cached_name = x.name.clone() x.cached_name = x.name.clone()
} }

View File

@ -372,8 +372,8 @@ struct PeDataDir {
struct PeDataDirs { struct PeDataDirs {
mut: mut:
debugnames [native.pe_num_data_dirs]string debugnames [pe_num_data_dirs]string
dirs [native.pe_num_data_dirs]PeDataDir dirs [pe_num_data_dirs]PeDataDir
base_addr i64 base_addr i64
} }