Handle hterm preferences with better care

This commit is contained in:
Iwasaki Yudai 2015-10-12 10:24:46 +09:00
parent 86151f1ac9
commit 589ec6b50a
89 changed files with 1396 additions and 742 deletions

31
Godeps/_workspace/src/github.com/yudai/hcl/lex.go generated vendored Normal file
View file

@ -0,0 +1,31 @@
package hcl
import (
"unicode"
)
type lexModeValue byte
const (
lexModeUnknown lexModeValue = iota
lexModeHcl
lexModeJson
)
// lexMode returns whether we're going to be parsing in JSON
// mode or HCL mode.
func lexMode(v string) lexModeValue {
for _, r := range v {
if unicode.IsSpace(r) {
continue
}
if r == '{' {
return lexModeJson
} else {
return lexModeHcl
}
}
return lexModeHcl
}