Skip to content

Commit a2ed1b3

Browse files
authored
Merge pull request #11 from MEschenbacher/fix-ipv6-ident
fix: ipv6 ident
2 parents 7eaddee + f0f502e commit a2ed1b3

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

scanner.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -196,4 +196,4 @@ func isLetter(ch rune) bool { return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && c
196196
// isDigit returns true if the rune is a digit.
197197
func isDigit(ch rune) bool { return (ch >= '0' && ch <= '9') }
198198

199-
func isMisc(ch rune) bool { return (ch == '.' || ch == '/' || ch == '-' || ch == '_') }
199+
func isMisc(ch rune) bool { return (ch == '.' || ch == '/' || ch == '-' || ch == '_' || ch == ':') }

scanner_test.go

+1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ func TestScanner_Scan(t *testing.T) {
2727
{s: `"hello \"my\" friend bla\`, tok: COMMENT, lit: "hello \\\"my\\\" friend bla\\"},
2828
{s: "hello friend", tok: IDENT, lit: "hello"},
2929
{s: "192.168.178.2/24", tok: IDENT, lit: "192.168.178.2/24"},
30+
{s: "2001:db8::/64", tok: IDENT, lit: "2001:db8::/64"},
3031
{s: "# 192.168.178.2/24", tok: COMMENTLINE, lit: " 192.168.178.2/24"},
3132
{s: "I_test_rule-something", tok: IDENT, lit: "I_test_rule-something"},
3233
} {

0 commit comments

Comments
 (0)