3f15326248
Update github.com/aws/aws-sdk-go and github.com/hashicorp/go-discover to pick up support for EC2 Metadata Instance Service v2 changes. Follow up to https://github.com/hashicorp/go-discover/pull/128 .
40 lines
565 B
Go
40 lines
565 B
Go
package ini
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
var (
|
|
equalOp = []rune("=")
|
|
equalColonOp = []rune(":")
|
|
)
|
|
|
|
func isOp(b []rune) bool {
|
|
if len(b) == 0 {
|
|
return false
|
|
}
|
|
|
|
switch b[0] {
|
|
case '=':
|
|
return true
|
|
case ':':
|
|
return true
|
|
default:
|
|
return false
|
|
}
|
|
}
|
|
|
|
func newOpToken(b []rune) (Token, int, error) {
|
|
tok := Token{}
|
|
|
|
switch b[0] {
|
|
case '=':
|
|
tok = newToken(TokenOp, equalOp, NoneType)
|
|
case ':':
|
|
tok = newToken(TokenOp, equalColonOp, NoneType)
|
|
default:
|
|
return tok, 0, NewParseError(fmt.Sprintf("unexpected op type, %v", b[0]))
|
|
}
|
|
return tok, 1, nil
|
|
}
|