// stringStartsWithIdentifier returns true if the given string begins with
// a character that is a legal start of an identifier: an underscore or
// any character that Unicode considers to be a letter.
762824
func stringStartsWithIdentifier(s string) bool {
	if len(s) == 0 {
		return false
	}

	first := s[0]

	// Easy ASCII cases first
	if (first >= 'a' && first <= 'z') || (first >= 'A' && first <= 'Z') || first == '_' {
		return true
	}

	// If our first byte begins a UTF-8 sequence then the sequence might
	// be a unicode letter.
	if utf8.RuneStart(first) {
		firstRune, _ := utf8.DecodeRuneInString(s)
		if unicode.IsLetter(firstRune) {
			return true
		}
	}

	return false
}
1282183
func Identifier() gopter.Gen {
	return gopter.CombineGens(
		AlphaLowerChar(),
		SliceOf(AlphaNumChar()),
	).Map(func(values []interface{}) string {
		first := values[0].(rune)
		tail := values[1].([]rune)
		result := make([]rune, 0, len(tail)+1)
		return string(append(append(result, first), tail...))
	}).SuchThat(func(str string) bool {
		if len(str) < 1 || !unicode.IsLower(([]rune(str))[0]) {
			return false
		}
		for _, ch := range str {
			if !unicode.IsLetter(ch) && !unicode.IsDigit(ch) {
				return false
			}
		}
		return true
	}).WithShrinker(StringShrinker)
}
156392
func GetIdentifier() Identifier {
	mu.Lock()
	defer mu.Unlock()

	if identifier == nil {
		identifier = &UUID{}
	}
	return identifier
}
860387
function __stringStartsWith(str, prefix) {
  // returns true for empty string or null prefix
  if ((!str)) return false;
  if (prefix == "" || prefix == null) return true;
  return str.indexOf(prefix, 0) === 0;
}
1160350
func (d decl) indexOfReplacementStart(idents []string) int {

	l := len(idents)

	if l == 0 {
		return -1
	}

	if l == 1 {
		first := idents[0]
		if first == "" || first == paramsIdentifier || first[0] == '$' {
			// This can not be a Params.x
			return -1
		}
	}

	var lookFurther bool
	var needsVarExpansion bool
	for _, ident := range idents {
		if ident[0] == '$' {
			lookFurther = true
			needsVarExpansion = true
			break
		} else if ident == paramsIdentifier {
			lookFurther = true
			break
		}
	}

	if !lookFurther {
		return -1
	}

	var resolvedIdents []string

	if !needsVarExpansion {
		resolvedIdents = idents
	} else {
		var ok bool
		resolvedIdents, ok = d.resolveVariables(idents)
		if !ok {
			return -1
		}
	}

	var paramFound bool
	for i, ident := range resolvedIdents {
		if ident == paramsIdentifier {
			if i > 0 {
				container := resolvedIdents[i-1]
				if reservedContainers[container] {
					// .Data.Params.someKey
					return -1
				}
			}

			paramFound = true
			break
		}
	}

	if !paramFound {
		return -1
	}

	var paramSeen bool
	idx := -1
	for i, ident := range idents {
		if ident == "" || ident[0] == '$' {
			continue
		}

		if ident == paramsIdentifier {
			paramSeen = true
			idx = -1

		} else {
			if paramSeen {
				return i
			}
			if idx == -1 {
				idx = i
			}
		}
	}
	return idx

}
927630
func (p *parser) parseIdentifier() (result string, err error) {
	startingDash := false
	if len(p.s) > p.i && p.s[p.i] == '-' {
		startingDash = true
		p.i++
	}

	if len(p.s) <= p.i {
		return "", errors.New("expected identifier, found EOF instead")
	}

	if c := p.s[p.i]; !(nameStart(c) || c == '\\') {
		return "", fmt.Errorf("expected identifier, found %c instead", c)
	}

	result, err = p.parseName()
	if startingDash && err == nil {
		result = "-" + result
	}
	return
}
6730
func (i IdentifierSet) AddIdentifiers(idents Identifiers) {
	for _, ident := range idents {
		i.Add(ident)
	}
}
269988
func SingularizeIdentifier(s string) string {
	if i := reverseIndexRune(s, '_'); i != -1 {
		s = s[:i] + "_" + inflector.Singularize(s[i+1:])
	} else {
		s = inflector.Singularize(s)
	}

	return snaker.SnakeToCamelIdentifier(s)
}
359700
func ident(isCaseSensitive bool, s string) string {
	if isCaseSensitive {
		return s
	}
	return strings.ToLower(s)
}
1174008
func (o *GetSkusIdentifierParams) WithIdentifier(identifier string) *GetSkusIdentifierParams {
	o.Identifier = identifier
	return o
}
1266076
func (i *Iter) InitString(f Form, src string) {
	i.p = 0
	if len(src) == 0 {
		i.setDone()
		i.rb.nsrc = 0
		return
	}
	i.multiSeg = nil
	i.rb.initString(f, src)
	i.next = i.rb.f.nextMain
	i.asciiF = nextASCIIString
	i.info = i.rb.f.info(i.rb.src, i.p)
}
1007226
func (o *GetObmsLibraryIdentifierParams) WithIdentifier(identifier string) *GetObmsLibraryIdentifierParams {
	o.Identifier = identifier
	return o
}
620253
func (o *GetNodesIdentifierTagsParams) WithIdentifier(identifier string) *GetNodesIdentifierTagsParams {
	o.Identifier = identifier
	return o
}
677127
func nameStart(c byte) bool {
	return 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || c == '_' || c > 127
}
373102
func FindFirstIdentity(node Node) string {
	l := findIdentities(node, nil).Strings()
	if len(l) == 0 {
		return ""
	}
	return l[0]
}
452865
func (o *GetSkusIdentifierNodesParams) WithIdentifier(identifier string) *GetSkusIdentifierNodesParams {
	o.Identifier = identifier
	return o
}
1025739
function isIdentifierStart(ch) {
        return (ch === '$') || (ch === '_') || (ch === '\\') ||
            (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') ||
            ((ch.charCodeAt(0) >= 0x80) && Regex.NonAsciiIdentifierStart.test(ch));
    }