From 3ff3b8abf6f24f676b6c03250ba96a365ae77b03 Mon Sep 17 00:00:00 2001 From: Charles Brunet Date: Tue, 22 Aug 2023 22:05:40 -0400 Subject: parser: more specific error for float numbers --- mesonbuild/mparser.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'mesonbuild') diff --git a/mesonbuild/mparser.py b/mesonbuild/mparser.py index 3697d8a..9867c71 100644 --- a/mesonbuild/mparser.py +++ b/mesonbuild/mparser.py @@ -863,6 +863,9 @@ class Parser: def method_call(self, source_object: BaseNode) -> MethodNode: methodname = self.e9() if not isinstance(methodname, IdNode): + if isinstance(source_object, NumberNode) and isinstance(methodname, NumberNode): + raise ParseException('meson does not support float numbers', + self.getline(), source_object.lineno, source_object.colno) raise ParseException('Method name must be plain id', self.getline(), self.current.lineno, self.current.colno) assert isinstance(methodname.value, str) -- cgit v1.1