scanner: fix the new string interpolation - println('{s == 'hello'}') (fix #16318) (#16319)

* scanner: fix the new string interpolation - println('{s == 'hello'}')

* fix vlib/v/eval/gen/infix_gen.v
This commit is contained in:
yuyi 2022-11-04 05:06:11 +08:00 committed by GitHub
parent 0e8d148fe7
commit fd4045931a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 22 deletions

View file

@ -34,7 +34,7 @@ fn test_giant_string() {
fn test_script_tag() {
mut parser := Parser{}
script_content := "\nvar googletag = googletag || {};\ngoogletag.cmd = googletag.cmd || [];if(3 > 5) {console.log('Birl');}\n"
script_content := "\nvar googletag = googletag || {};\ngoogletag.cmd = googletag.cmd || [];if(3 > 5) { console.log('Birl');}\n"
temp_html := '<html><body><script>$script_content</script></body></html>'
parser.parse_html(temp_html)
assert parser.tags[2].content.len == script_content.replace('\n', '').len