增加环绕侦察场景适配

This commit is contained in:
2026-01-08 15:44:38 +08:00
parent 3eba1f962b
commit 10c5bb5a8a
5441 changed files with 40219 additions and 379695 deletions

View File

@@ -155,14 +155,14 @@ def ewarn(message):
class Expr:
"""Represents a Fortran expression as a op-data pair.
"""Represents a Fortran expression as an op-data pair.
Expr instances are hashable and sortable.
"""
@staticmethod
def parse(s, language=Language.C):
"""Parse a Fortran expression to a Expr.
"""Parse a Fortran expression to an Expr.
"""
return fromstring(s, language=language)
@@ -1236,6 +1236,8 @@ def replace_parenthesis(s):
i = mn_i
j = s.find(right, i)
if j == -1:
raise ValueError(f'Mismatch of {left + right} parenthesis in {s!r}')
while s.count(left, i + 1, j) != s.count(right, i + 1, j):
j = s.find(right, j + 1)
@@ -1478,7 +1480,7 @@ class _FromStringWorker:
if isinstance(items, Expr):
return items
if paren in ['ROUNDDIV', 'SQUARE']:
# Expression is a array constructor
# Expression is an array constructor
if isinstance(items, Expr):
items = (items,)
return as_array(items)