增加环绕侦察场景适配
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user