From 20c47e3468d4cdd92859702cbacf034ce076e6e2 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Mon, 10 Jun 2024 09:17:07 -0700 Subject: [PATCH] Apply black. Node, Jade, I did not get bitten by the CI check :^) Signed-off-by: Danila Fedorin --- tools/chpl-language-server/src/chpl-language-server.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/chpl-language-server/src/chpl-language-server.py b/tools/chpl-language-server/src/chpl-language-server.py index d4863e6f66f9..6cdea80286eb 100755 --- a/tools/chpl-language-server/src/chpl-language-server.py +++ b/tools/chpl-language-server/src/chpl-language-server.py @@ -145,6 +145,7 @@ REAL_NUMBERIC = (chapel.RealLiteral, chapel.IntLiteral, chapel.UintLiteral) NUMERIC = REAL_NUMBERIC + (chapel.ImagLiteral,) + def is_basic_literal_like(node: chapel.AstNode) -> Optional[chapel.Literal]: """ Check for "basic" literals: basically, 1, "hello", -42, etc. @@ -155,7 +156,11 @@ def is_basic_literal_like(node: chapel.AstNode) -> Optional[chapel.Literal]: if isinstance(node, chapel.Literal): return node - if isinstance(node, chapel.OpCall) and node.op() == "-" and node.num_actuals() == 1: + if ( + isinstance(node, chapel.OpCall) + and node.op() == "-" + and node.num_actuals() == 1 + ): # Do not recurse; do not consider --42 as a basic literal. act = node.actual(0) if isinstance(act, NUMERIC): @@ -163,6 +168,7 @@ def is_basic_literal_like(node: chapel.AstNode) -> Optional[chapel.Literal]: return None + def is_literal_like(node: chapel.AstNode) -> bool: if is_basic_literal_like(node): return True