0
0
mirror of https://github.com/crazy-max/diun.git synced 2024-12-22 19:38:28 +00:00
crazy-max_diun/vendor/github.com/vanng822/css/skip_rule.go
2024-12-14 22:30:21 +01:00

33 lines
504 B
Go

package css
import "github.com/gorilla/css/scanner"
func skipRules(s *scanner.Scanner) {
var (
open int
close int
started bool
)
for {
if started && close >= open {
return
}
token := s.Next()
if token.Type == scanner.TokenEOF || token.Type == scanner.TokenError {
return
}
if token.Type == scanner.TokenChar {
if token.Value == "{" {
open++
started = true
continue
}
if token.Value == "}" {
close++
started = true
continue
}
}
}
}