Skip to content

Commit

Permalink
Fix RawVerbose (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
hedhyw authored Jul 1, 2022
1 parent cd2ab1d commit 510f3a9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/dialect/base/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Common CommonBaseDialect = "CommonBaseDialect"

// Raw appends regular expression as is.
func (CommonBaseDialect) Raw(raw string) RawToken {
return RawToken{value: raw, verbose: true}
return RawToken{value: raw, verbose: false}
}

// RawVerbose appends regular expression and removes comments, spaces and new lines.
Expand Down
4 changes: 4 additions & 0 deletions pkg/dialect/base/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ func TestRexCommon(t *testing.T) {
Name: "Raw",
Chain: []dialect.Token{base.Common.Raw(`^[A-Z]+$`)},
Expected: `^[A-Z]+$`,
}, {
Name: "RawNotVerbose",
Chain: []dialect.Token{base.Common.Raw(`.+$ # not_comment`)},
Expected: `.+$ # not_comment`,
}, {
Name: "Text",
Chain: []dialect.Token{base.Common.Text(`hello world`)},
Expand Down

0 comments on commit 510f3a9

Please sign in to comment.