mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
pref: -experimental flag
This commit is contained in:
parent
df45488e09
commit
361d12bf43
@ -270,7 +270,7 @@ fn (mut g Gen) call_expr(node ast.CallExpr) {
|
|||||||
g.write('$styp $tmp_opt = ')
|
g.write('$styp $tmp_opt = ')
|
||||||
}
|
}
|
||||||
if node.is_method && !node.is_field {
|
if node.is_method && !node.is_field {
|
||||||
if node.name == 'writeln' && g.pref.show_cc &&
|
if node.name == 'writeln' && g.pref.experimental &&
|
||||||
node.args.len > 0 && node.args[0].expr is ast.StringInterLiteral &&
|
node.args.len > 0 && node.args[0].expr is ast.StringInterLiteral &&
|
||||||
g.table.get_type_symbol(node.receiver_type).name == 'strings.Builder' {
|
g.table.get_type_symbol(node.receiver_type).name == 'strings.Builder' {
|
||||||
g.string_inter_literal_sb_optimized(node)
|
g.string_inter_literal_sb_optimized(node)
|
||||||
|
@ -116,6 +116,7 @@ pub mut:
|
|||||||
error_limit int
|
error_limit int
|
||||||
is_vweb bool // skip _ var warning in templates
|
is_vweb bool // skip _ var warning in templates
|
||||||
only_check_syntax bool // when true, just parse the files, then stop, before running checker
|
only_check_syntax bool // when true, just parse the files, then stop, before running checker
|
||||||
|
experimental bool // enable experimental features
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn parse_args(args []string) (&Preferences, string) {
|
pub fn parse_args(args []string) (&Preferences, string) {
|
||||||
@ -196,6 +197,9 @@ pub fn parse_args(args []string) (&Preferences, string) {
|
|||||||
'-showcc' {
|
'-showcc' {
|
||||||
res.show_cc = true
|
res.show_cc = true
|
||||||
}
|
}
|
||||||
|
'-experimental' {
|
||||||
|
res.experimental = true
|
||||||
|
}
|
||||||
'-usecache' {
|
'-usecache' {
|
||||||
res.use_cache = true
|
res.use_cache = true
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user