Skip to content

Commit

Permalink
fix: ipv6 ident
Browse files Browse the repository at this point in the history
  • Loading branch information
MEschenbacher committed Mar 31, 2024
1 parent 275b7c9 commit 3bb8ea9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,4 +192,4 @@ func isLetter(ch rune) bool { return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && c
// isDigit returns true if the rune is a digit.
func isDigit(ch rune) bool { return (ch >= '0' && ch <= '9') }

func isMisc(ch rune) bool { return (ch == '.' || ch == '/' || ch == '-') }
func isMisc(ch rune) bool { return (ch == '.' || ch == '/' || ch == '-' || ch == ':') }
1 change: 1 addition & 0 deletions scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ func TestScanner_Scan(t *testing.T) {
{s: `"hello \"my\" friend bla\`, tok: COMMENT, lit: "hello \\\"my\\\" friend bla\\"},
{s: "hello friend", tok: IDENT, lit: "hello"},
{s: "192.168.178.2/24", tok: IDENT, lit: "192.168.178.2/24"},
{s: "2001:db8::/64", tok: IDENT, lit: "2001:db8::/64"},
{s: "# 192.168.178.2/24", tok: COMMENTLINE, lit: " 192.168.178.2/24"},
} {
s := newScanner(strings.NewReader(tc.s))
Expand Down

0 comments on commit 3bb8ea9

Please sign in to comment.