mirror of
https://github.com/yudai/gotty.git
synced 2026-02-26 01:44:07 +01:00
Handle hterm preferences with better care
This commit is contained in:
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
31
Godeps/_workspace/src/github.com/yudai/hcl/lex.go
generated
vendored
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue