MCPcopy Create free account
hub / github.com/codemix/graph / peg$f83

Function peg$f83

packages/graph/src/grammar.js:1022–1039  ·  view source on GitHub ↗
(optional, patterns)

Source from the content-addressed store, hash-verified

1020 };
1021 }
1022 function peg$f83(optional, patterns) {
1023 // If single pattern, return as-is. If multiple, wrap in MultiPattern.
1024 if (patterns.length === 1) {
1025 return {
1026 type: 'MatchClause',
1027 pattern: patterns[0],
1028 optional: optional !== null
1029 };
1030 }
1031 return {
1032 type: 'MatchClause',
1033 pattern: {
1034 type: 'MultiPattern',
1035 patterns: patterns
1036 },
1037 optional: optional !== null
1038 };
1039 }
1040 function peg$f84(head, tail) {
1041 return [head, ...tail.map(t => t[3])];
1042 }

Callers 1

peg$parseMatchClauseFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected