mirror of
https://github.com/mesonbuild/meson.git
synced 2026-11-06 05:16:42 +00:00
mparser: fix strict_optional issue
This allows reporting as dead code any checks for None in the interpreter. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
1 parent
77befa9bc8
commit
3959dc9e8e
1 file changed
+3
-2
@@ -8,7 +8,7 @@ import codecs
|
||||
import os
|
||||
import typing as T
|
||||
|
||||
from .mesonlib import MesonException
|
||||
from .mesonlib import MesonException, unwrap
|
||||
from . import mlog
|
||||
|
||||
if T.TYPE_CHECKING:
|
||||
@@ -855,7 +855,8 @@ class Parser:
|
||||
temp_node.append_whitespaces(w)
|
||||
|
||||
not_token.bytespan = (not_token.bytespan[0], in_token.bytespan[1])
|
||||
not_token.value += temp_node.whitespaces.value + in_token.value
|
||||
# whitespace between not and in must have been added above
|
||||
not_token.value += unwrap(temp_node.whitespaces).value + in_token.value
|
||||
operator = self.create_node(SymbolNode, not_token)
|
||||
return self.create_node(ComparisonNode, 'not in', left, operator, self.e5())
|
||||
return left
|
||||
|
||||
Reference in new issue
Block a user