vendor dependencies with dep
This commit is contained in:
parent
93d8310491
commit
1384296a47
2712 changed files with 965742 additions and 0 deletions
56
vendor/github.com/vanng822/css/import_parser.go
generated
vendored
Normal file
56
vendor/github.com/vanng822/css/import_parser.go
generated
vendored
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
package css
|
||||
|
||||
import (
|
||||
//"fmt"
|
||||
"github.com/gorilla/css/scanner"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func newImportRule(statement string) *CSSRule {
|
||||
statement = strings.TrimSpace(statement)
|
||||
if statement != "" {
|
||||
rule := NewRule(IMPORT_RULE)
|
||||
rule.Style.SelectorText = statement
|
||||
return rule
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func parseImport(s *scanner.Scanner) *CSSRule {
|
||||
/*
|
||||
Syntax:
|
||||
@import url; or
|
||||
@import url list-of-media-queries;
|
||||
|
||||
Example:
|
||||
@import url("fineprint.css") print;
|
||||
@import url("bluish.css") projection, tv;
|
||||
@import 'custom.css';
|
||||
@import url("chrome://communicator/skin/");
|
||||
@import "common.css" screen, projection;
|
||||
@import url('landscape.css') screen and (orientation:landscape);
|
||||
|
||||
*/
|
||||
|
||||
var statement string
|
||||
for {
|
||||
token := s.Next()
|
||||
|
||||
//fmt.Printf("Import: %s:'%s'\n", token.Type.String(), token.Value)
|
||||
|
||||
if token.Type == scanner.TokenEOF || token.Type == scanner.TokenError {
|
||||
return nil
|
||||
}
|
||||
// take everything for now
|
||||
switch token.Type {
|
||||
case scanner.TokenChar:
|
||||
if token.Value == ";" {
|
||||
return newImportRule(statement)
|
||||
}
|
||||
statement += token.Value
|
||||
default:
|
||||
statement += token.Value
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue