1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

repl: fix comparison operator treated as statement (#18304)

This commit is contained in:
Felipe Pena 2023-06-02 04:54:43 -03:00 committed by GitHub
parent 5e12d3483c
commit 82035f7610
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -423,7 +423,8 @@ fn run_repl(workdir string, vrepl_prefix string) int {
' as ',
]
mut is_statement := false
if filter_line.count('=') % 2 == 1 {
if filter_line.count('=') % 2 == 1
&& (filter_line.count('!=') + filter_line.count('>=') + filter_line.count('<=')) == 0 {
is_statement = true
} else {
for pattern in possible_statement_patterns {