| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Ecluse.Core.Version.Token
Description
The lexical atoms and the length bound the per-ecosystem version grammars share.
A VToken is a single numeric or textual run, ordered by the rule the RubyGems and PEP
440-local grammars have in common. The semver prerelease rule is the opposite, so it lives
with the semver grammar. Everything here is purely lexical.
Documentation
A version token: a numeric or a textual run. Numeric tokens outrank textual ones, numerics compare numerically, and text compares lexically.
Instances
numOr0 :: Text -> Integer Source #
Read an all-digit (already validated) run as an integer, defaulting to 0.
isAsciiAlphaNum :: Char -> Bool Source #
An ASCII letter or ASCII digit. The PEP 440 and Gem::Version grammars are ASCII-only,
so the Unicode-aware isAlphaNum would over-accept and mis-order a non-ASCII digit.
classifyRun :: Text -> VToken Source #
withinVersionLength :: Text -> Bool Source #
Whether a raw version string is short enough for the grammars to parse. Past the bound a version gets no ordering key and is served raw.