v.scanner: fix position of hash statements (#9222)

pull/9242/head
StunxFS 2021-03-10 14:23:17 -04:00 committed by GitHub
parent 141a6db16b
commit 6a7ef4f5b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 11 deletions

View File

@ -1,3 +1,3 @@
vlib/v/checker/tests/comptime_env/env_parser_errors_1.vv:1:3: error: supply an env variable name like HOME, PATH or USER vlib/v/checker/tests/comptime_env/env_parser_errors_1.vv:1:1: error: supply an env variable name like HOME, PATH or USER
1 | #flag -I $env('')/xyz 1 | #flag -I $env('')/xyz
| ~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~

View File

@ -1,3 +1,3 @@
vlib/v/checker/tests/comptime_env/env_parser_errors_2.vv:1:3: error: cannot use string interpolation in compile time $env() expression vlib/v/checker/tests/comptime_env/env_parser_errors_2.vv:1:1: error: cannot use string interpolation in compile time $env() expression
1 | #flag -I $env('$ABC')/xyz 1 | #flag -I $env('$ABC')/xyz
| ~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -1,3 +1,3 @@
vlib/v/checker/tests/comptime_env/env_parser_errors_3.vv:1:3: error: no "$env('...')" could be found in "-I $env()/xyz". vlib/v/checker/tests/comptime_env/env_parser_errors_3.vv:1:1: error: no "$env('...')" could be found in "-I $env()/xyz".
1 | #flag -I $env()/xyz 1 | #flag -I $env()/xyz
| ~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~

View File

@ -1,11 +1,11 @@
vlib/v/checker/tests/comptime_env/using_comptime_env.vv:1:3: error: the environment variable "VAR" does not exist. vlib/v/checker/tests/comptime_env/using_comptime_env.vv:1:1: error: the environment variable "VAR" does not exist.
1 | #flag -I $env('VAR')/xyz 1 | #flag -I $env('VAR')/xyz
| ~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~
2 | #include "$env('VAR')/stdio.h" 2 | #include "$env('VAR')/stdio.h"
3 | 3 |
vlib/v/checker/tests/comptime_env/using_comptime_env.vv:2:3: error: the environment variable "VAR" does not exist. vlib/v/checker/tests/comptime_env/using_comptime_env.vv:2:1: error: the environment variable "VAR" does not exist.
1 | #flag -I $env('VAR')/xyz 1 | #flag -I $env('VAR')/xyz
2 | #include "$env('VAR')/stdio.h" 2 | #include "$env('VAR')/stdio.h"
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3 | 3 |
4 | fn main() { 4 | fn main() {

View File

@ -894,7 +894,7 @@ fn (mut s Scanner) text_scan() token.Token {
return s.new_token(.comment, comment, comment.len + 2) return s.new_token(.comment, comment, comment.len + 2)
} }
hash := s.text[start..s.pos].trim_space() hash := s.text[start..s.pos].trim_space()
return s.new_token(.hash, hash, hash.len) return s.new_token(.hash, hash, hash.len + 2)
} }
`>` { `>` {
if nextc == `=` { if nextc == `=` {