mirror of
https://github.com/crazy-max/diun.git
synced 2025-01-27 01:08:50 +00:00
32 lines
504 B
Go
32 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
|
|
}
|
|
}
|
|
}
|
|
}
|