url/helpers

Helper routines for the parser

Copyright (C) 2025-2026 Trayambak Rai (xtrayambak@disroot.org)

Procs

func containsForbiddenDomainCodePoint(input: StringView): uint8 {....raises: [],
    tags: [], forbids: [].}
func findAuthorityDelimiter(view: StringView): uint32 {....raises: [], tags: [],
    forbids: [].}
func findAuthorityDelimiterSpecial(view: StringView): uint32 {....raises: [],
    tags: [], forbids: [].}
func findNextHostDelimiter(view: StringView; location: uint32): uint32 {.inline,
    ...raises: [], tags: [], forbids: [].}
func findNextHostDelimiterSpecial(view: views.StringView; location: uint32): uint32 {.
    ...raises: [], tags: [], forbids: [].}
func getHostDelimiterFunction(isSpecial: bool; view: StringView): tuple[
    location: uint32, foundColon: bool] {....raises: [], tags: [], forbids: [].}
func hasTabsOrNewline(view: views.StringView): bool {.inline, ...raises: [],
    tags: [], forbids: [].}
func isAlnumPlus(c: uint8 | char): bool {.inline, ...raises: [], cdecl.}
func isForbiddenDomainCodePoint(c: char): bool {.inline, ...raises: [], tags: [],
    forbids: [].}
func isTabsOrNewline(c: char): bool {.inline, ...raises: [], cdecl, ...tags: [],
                                      forbids: [].}
func pruneFragment(input: var StringView): Option[string] {....raises: [], cdecl,
    ...tags: [], forbids: [].}
func removeAsciiTabOrNewline(input: string): string {....raises: [], tags: [],
    forbids: [].}
func resize(view: var StringView; pos: uint32) {.inline, ...raises: [], tags: [],
    forbids: [].}
func shortenPath(path: var string; typ: SchemeType): bool {.inline, ...raises: [],
    tags: [], forbids: [].}
func trimC0Whitespace(input: var StringView) {....raises: [], tags: [], forbids: [].}