parent
7555b337b9
commit
7bc3e67e24
|
@ -42,7 +42,6 @@ const (
|
|||
]
|
||||
vfmt_known_failing_exceptions = arrays.merge(verify_known_failing_exceptions, [
|
||||
'vlib/regex/regex_test.v' /* contains meaningfull formatting of the test case data */,
|
||||
'vlib/readline/readline_test.v' /* vfmt eats `{ Readline }` from `import readline { Readline }` */,
|
||||
'vlib/glm/glm.v' /* `mut res &f32` => `mut res f32`, which then fails to compile */,
|
||||
'vlib/crypto/sha512/sha512block_generic.v' /* formatting of large constant arrays wraps to too many lines */,
|
||||
'vlib/crypto/aes/const.v' /* formatting of large constant arrays wraps to too many lines */,
|
||||
|
|
|
@ -17,4 +17,4 @@ fn test_struct_readline() {
|
|||
// eprintln('methods: $methods')
|
||||
assert 'read_line_utf8' in methods
|
||||
assert 'read_line' in methods
|
||||
}
|
||||
}
|
||||
|
|
|
@ -760,6 +760,7 @@ pub fn (mut f Fmt) branch_stmt(node ast.BranchStmt) {
|
|||
pub fn (mut f Fmt) comp_for(node ast.CompFor) {
|
||||
typ := f.no_cur_mod(f.table.type_to_str_using_aliases(node.typ, f.mod2alias))
|
||||
f.write('\$for $node.val_var in ${typ}.$node.kind.str() {')
|
||||
f.mark_types_import_as_used(node.typ)
|
||||
if node.stmts.len > 0 || node.pos.line_nr < node.pos.last_line {
|
||||
f.writeln('')
|
||||
f.stmts(node.stmts)
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
import readline { Readline }
|
||||
|
||||
fn no_lines(s string) string {
|
||||
return s.replace('\n', ' ')
|
||||
}
|
||||
|
||||
fn main() {
|
||||
mut methods := []string{}
|
||||
$for method in Readline.methods {
|
||||
methods << method.name
|
||||
}
|
||||
assert 'read_line_utf8' in methods
|
||||
assert 'read_line' in methods
|
||||
}
|
Loading…
Reference in New Issue