Skip to content

Commit acfa088

Browse files
committed
v.build_constraint: support comments too, for example linux&&gcc // some comment
1 parent ad20a57 commit acfa088

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

cmd/v/v.v

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,10 @@ fn setup_vbuild_env_vars(prefs &pref.Preferences) {
229229
sdefines := prefs.compile_defines_all.join(',')
230230
os.setenv('VBUILD_DEFINES', sdefines, true)
231231

232+
$if trace_vbuild ? {
233+
eprintln('> VBUILD_FACTS: ${sfacts}')
234+
eprintln('> VBUILD_DEFINES: ${sdefines}')
235+
}
232236
unsafe { sdefines.free() }
233237
unsafe { sfacts.free() }
234238
unsafe { github_job.free() }

vlib/v/build_constraint/lexing.v

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ fn new_span(kind BTokenKind, mut span []u8) Token {
3838
return t
3939
}
4040

41-
fn lex(s string) ![]Token {
41+
fn lex(original string) ![]Token {
4242
mut res := []Token{}
43-
mut span := []u8{cap: s.len}
43+
mut span := []u8{cap: original.len}
4444
mut op := []u8{}
45+
s := original.all_before('//')
4546
for c in s {
4647
match c {
4748
` `, `\t`, `\n` {}

0 commit comments

Comments
 (0)