v.build_constraint: support comments too, for example linux&&gcc // some comment

This commit is contained in:
Delyan Angelov 2025-03-12 14:21:23 +02:00
parent ad20a57139
commit acfa088b60
No known key found for this signature in database
GPG Key ID: 66886C0F12D595ED
2 changed files with 7 additions and 2 deletions

View File

@ -229,6 +229,10 @@ fn setup_vbuild_env_vars(prefs &pref.Preferences) {
sdefines := prefs.compile_defines_all.join(',')
os.setenv('VBUILD_DEFINES', sdefines, true)
$if trace_vbuild ? {
eprintln('> VBUILD_FACTS: ${sfacts}')
eprintln('> VBUILD_DEFINES: ${sdefines}')
}
unsafe { sdefines.free() }
unsafe { sfacts.free() }
unsafe { github_job.free() }

View File

@ -38,10 +38,11 @@ fn new_span(kind BTokenKind, mut span []u8) Token {
return t
}
fn lex(s string) ![]Token {
fn lex(original string) ![]Token {
mut res := []Token{}
mut span := []u8{cap: s.len}
mut span := []u8{cap: original.len}
mut op := []u8{}
s := original.all_before('//')
for c in s {
match c {
` `, `\t`, `\n` {}