Skip to content

Commit

Permalink
Merge pull request #11 from MEschenbacher/fix-ipv6-ident
Browse files Browse the repository at this point in the history
fix: ipv6 ident
  • Loading branch information
leonnicolas authored Mar 31, 2024
2 parents 7eaddee + f0f502e commit a2ed1b3
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 @@ -196,4 +196,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 == '-' || ch == '_') }
func isMisc(ch rune) bool { return (ch == '.' || 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: "I_test_rule-something", tok: IDENT, lit: "I_test_rule-something"},
} {
Expand Down

0 comments on commit a2ed1b3

Please sign in to comment.