// Rune renders the rune identifier.
173695
func (g *Group) Rune() *Statement {
	// notest
	s := Rune()
	g.items = append(g.items, s)
	return s
}
545254
func allowedNameRune(r rune) bool {
	// will include <> in the IRI value
	return r > 0x20 && !strings.ContainsRune("\"{}()|^`", r) && !unicode.IsSpace(r)
}
981834
func sanitize(r rune) rune {
	switch {
	case r == '`':
		return -1
	case r == '\t', r == '\n':
		return r
	case r >= ' ' && r <= '~':
		return r
	}
	return -1
}
106341
func RuneRange(min, max rune) gopter.Gen {
	return genRune(Int64Range(int64(min), int64(max)))
}
685231
func (p *parser) addUnitOne(ch rune) {
	if p.useOptionI() {
		ch = unicode.ToLower(ch)
	}

	p.unit = newRegexNodeCh(ntOne, p.options, ch)
}
255752
func CompatJamo(r rune) rune {
	switch {
	case G <= r && r <= H:
		return r
	case A <= r && r <= I:
		return r
	case MEDIAL_A <= r && r <= MEDIAL_I:
		return r - MEDIAL_BASE + A
	}
	if c, ok := toCompatJamo[r]; ok {
		return c
	}

	return 0
}
1205946
func RuneToken(r rune) Token {
	return Token{Type: r, Value: string(r)}
}
313625
func (a luhnAlphabet) generate(s string) (rune, error) {
	factor := 1
	sum := 0
	n := len(a)

	for i := range s {
		codepoint := strings.IndexByte(string(a), s[i])
		if codepoint == -1 {
			return 0, fmt.Errorf("Digit %q not valid in alphabet %q", s[i], a)
		}
		addend := factor * codepoint
		if factor == 2 {
			factor = 1
		} else {
			factor = 2
		}
		addend = (addend / n) + (addend % n)
		sum += addend
	}
	remainder := sum % n
	checkCodepoint := (n - remainder) % n
	return rune(a[checkCodepoint]), nil
}
1271982
func escapeExKey(key *escapeKeyPair) rune {
	var r rune
	switch key.typ {
	case 'D':
		r = CharBackward
	case 'C':
		r = CharForward
	case 'A':
		r = CharPrev
	case 'B':
		r = CharNext
	case 'H':
		r = CharLineStart
	case 'F':
		r = CharLineEnd
	case '~':
		if key.attr == "3" {
			r = CharDelete
		}
	default:
	}
	return r
}
582091
func Runes(a, b []rune) []Change {
	return Diff(len(a), len(b), &runes{a, b})
}
567634
func IsIdentifierRune(r rune) bool {
	if unicode.IsLetter(r) || unicode.IsDigit(r) {
		return true
	}
	for _, allowedRune := range IDENTITY_CHARS {
		if allowedRune == r {
			return true
		}
	}
	return false
}
406023
func Rune2Class(r rune) int {
	if r >= 0 && r < 0x80 { // Keep ASCII as it is.
		return int(r)
	}
	if unicode.IsLetter(r) {
		return classUnicodeLeter
	}
	if unicode.IsDigit(r) {
		return classUnicodeDigit
	}
	if unicode.IsGraphic(r) {
		return classUnicodeGraphic
	}
	if r == lex.RuneEOF {
		return int(r)
	}
	return classOther
}
729758
func (t Type) Symbol() rune {
	switch t {
	case Exterior:
		return 'e'
	case Boundary:
		return 'b'
	case Interior:
		return 'i'
	case None:
		return '-'
	}
	panic(fmt.Sprintf("Unknown location value: %v", int(t)))
}
1028926
func keyRuneFilter(r rune) rune {
	if r <= ' ' || r == '=' || r == '"' || r == utf8.RuneError {
		return -1
	}
	return r
}
350044
func (l *lexer) pattern() ([]rune, Error) {
	// read until we hit the first whitespace/end of line/eof rune
	_pattern := make([]rune, 0, 1)

	// loop until there's nothing more to do
	for {
		_r, _err := l.read()
		if _err != nil {
			return _pattern, _err
		}

		// what is the next rune?
		switch _r {
		// whitespace, newline, end of file, separator
		//		- this is the end of the pattern
		case _SPACE:
			fallthrough
		case _TAB:
			fallthrough
		case _CR:
			fallthrough
		case _NEWLINE:
			fallthrough
		case _SEPARATOR:
			fallthrough
		case _EOF:
			// return what we have
			l.unread(_r)
			return _pattern, nil

		// a wildcard is the end of the pattern if it is part of any '**'
		case _WILDCARD:
			_next, _err := l.peek()
			if _err != nil {
				return _pattern, _err
			} else if _next == _WILDCARD {
				l.unread(_r)
				return _pattern, _err
			} else {
				_pattern = append(_pattern, _r)
			}

		// escape sequence - consume the next rune
		case _ESCAPE:
			_escape, _err := l.escape()
			if _err != nil {
				return _pattern, _err
			}

			// add the escape sequence as part of the pattern
			_pattern = append(_pattern, _escape...)

		// any other character, we add to the pattern
		default:
			_pattern = append(_pattern, _r)
		}
	}
}
1287002
func Stroke(r rune) (c int) {
	if 0xAC00 <= r && r <= 0xD7A3 {
		i, m, f := Split(r)
		c += Stroke(i)
		c += Stroke(m)
		c += Stroke(f)
		return
	}

	jm := CompatJamo(r)
	if es, ok := SplitMultiElement(jm); ok {
		for _, e := range es {
			c += strokes[e]
		}
	} else {
		c = strokes[jm]
	}
	return
}
1013183
func RepeatRune(r rune, n int) string {
	var sb strings.Builder
	for i := 0; i < n; i++ {
		sb.WriteRune(r)
	}
	return sb.String()
}