summaryrefslogtreecommitdiffstats
path: root/parsers/survex.py
diff options
context:
space:
mode:
Diffstat (limited to 'parsers/survex.py')
-rw-r--r--parsers/survex.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/parsers/survex.py b/parsers/survex.py
index d91eabe..6cff3e5 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -497,9 +497,10 @@ class LoadingSurvex:
def LoadSurvexAlias(self, survexblock, line):
# *alias station - ..
- splayalias = re.match("(?i)station\s*\-\s*\.\.\s*$", line)
+ splayalias = re.match("(?i)\s*station\s*\-\s*\.\.\s*$", line)
if splayalias:
self.flagsstar["splayalias"] = True
+ print(line)
else:
message = f"! Bad *ALIAS: '{line}' ({survexblock}) {survexblock.survexfile.path}"
print(self.insp + message)
@@ -696,7 +697,13 @@ class LoadingSurvex:
survexleg = SurvexLeg()
# skip all splay legs
- try:
+ try:
+ if "splayalias" in self.flagsstar:
+ if ls[datastar["from"]] == "-" or ls[datastar["to"]] == "-":
+ if debugprint:
+ print("Aliased splay in ", survexblock.survexfile.path)
+ return
+
if ls[datastar["from"]] == ".." or ls[datastar["from"]] == ".":
if debugprint:
print("Splay in ", survexblock.survexfile.path)
@@ -705,15 +712,14 @@ class LoadingSurvex:
if debugprint:
print("Splay in ", survexblock.survexfile.path)
return
- if self.flagsstar["splayalias"]:
- if ls[datastar["from"]] == "-":
- if debugprint:
- print("Aliased splay in ", survexblock.survexfile.path)
- return
- if ls[datastar["to"]] == "-":
- if debugprint:
- print("Aliased splay in ", survexblock.survexfile.path)
- return
+
+ if ls[datastar["to"]] == "-":
+ message = f" ! Suspected splay, not declared, in line {ls} in {survexblock.survexfile.path}"
+ print(self.insp + message)
+ stash_data_issue(
+ parser="survexleg", message=message, url=None, sb=(survexblock.survexfile.path)
+ )
+ return
except:
message = f" ! datastar parsing from/to incorrect in line {ls} in {survexblock.survexfile.path}"
print(self.insp + message)