Skip to content

Commit

Permalink
:prefix & :postfix are no longer valid capture names
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Mornini committed May 19, 2017
1 parent db8b017 commit 26421a6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions 05-expected-response-match-parser.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package main

import (
"errors"
"fmt"
"regexp"
"strings"
Expand Down Expand Up @@ -49,6 +50,17 @@ func expectedResponseMatchParser(context *context) {
}

for i := 1; i < count-1; i += 3 {
captureName := parts[i]

if captureName == ":prefix" || captureName == ":postfix" {
errorHandler(
context,
errors.New("capture names cannot be :prefix or :postfix"),
)

return
}

reString := "("

switch parts[i+1] {
Expand Down

0 comments on commit 26421a6

Please sign in to comment.