MCPcopy Create free account
hub / github.com/circlefin/arc-node / _extract_heredoc_delimiter

Method _extract_heredoc_delimiter

scripts/md-exec.py:102–118  ·  view source on GitHub ↗

Extract heredoc delimiter from a command if present. Supports patterns like: - << EOF - <<EOF - << 'EOF' - << "EOF" - <<- EOF (with tab stripping) Returns the delimiter string (unquoted) or None if no heredoc.

(self, cmd)

Source from the content-addressed store, hash-verified

100 return ShellTest(cmd, expected_str, line_num, timeout, expected_fail, options.copy(), strip_output, exit_check, empty_output)
101
102 def _extract_heredoc_delimiter(self, cmd):
103 """Extract heredoc delimiter from a command if present.
104
105 Supports patterns like:
106 - << EOF
107 - <<EOF
108 - << 'EOF'
109 - << "EOF"
110 - <<- EOF (with tab stripping)
111
112 Returns the delimiter string (unquoted) or None if no heredoc.
113 """
114 # Match heredoc pattern: <<[-][ ]?['"]?WORD['"]?
115 match = re.search(r'<<-?\s*[\'"]?(\w+)[\'"]?\s*$&#x27;, cmd)
116 if match:
117 return match.group(1)
118 return None
119
120 def parse(self):
121 tests = []

Callers 1

parseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected