prthm11 commited on
Commit
103abcf
·
verified ·
1 Parent(s): eddb24c

Update utils/block_relation_builder.py

Browse files
Files changed (1) hide show
  1. utils/block_relation_builder.py +4 -2
utils/block_relation_builder.py CHANGED
@@ -1863,8 +1863,10 @@ def classify(line):
1863
 
1864
  # Control Blocks
1865
  # if re.match(r"wait (.+?) seconds", l): return "control_wait", "stack"
1866
- if re.match(r"wait\s+(\(?\[?.+?\]?\)?)\s*(sec(?:ond)?s?)?$", l): return "control_wait", "stack"
1867
- if l.startswith("wait until <"): return "control_wait_until", "stack"
 
 
1868
  if l.startswith("repeat ("): return "control_repeat", "c_block"
1869
  if l == "forever": return "control_forever", "c_block"
1870
  if l.startswith("if <") and " then go" in l: return "control_if_else", "c_block"
 
1863
 
1864
  # Control Blocks
1865
  # if re.match(r"wait (.+?) seconds", l): return "control_wait", "stack"
1866
+ # if re.match(r"wait\s+(\(?\[?.+?\]?\)?)\s*(sec(?:ond)?s?)?$", l): return "control_wait", "stack"
1867
+ # if l.startswith("wait until <"): return "control_wait_until", "stack"
1868
+ if re.match(r"wait\s+(?!until)(\(?\[?.+?\]?\)?)\s*(sec(?:ond)?s?)?$", l, re.IGNORECASE): return "control_wait", "stack"
1869
+ if re.match(r"wait\s+until\s*<", l, re.IGNORECASE): return "control_wait_until", "stack"
1870
  if l.startswith("repeat ("): return "control_repeat", "c_block"
1871
  if l == "forever": return "control_forever", "c_block"
1872
  if l.startswith("if <") and " then go" in l: return "control_if_else", "c_block"