seedwing-io / seedwing-policy

A functional type system for policy inspection, audit and enforcement.
https://www.seedwing.io
Apache License 2.0
12 stars 15 forks source link

feat: add a semantic version parser. Fixes #158 #191

Closed jbtrystram closed 1 year ago

jbtrystram commented 1 year ago

Question for the person that will review this :

Should the semver.dog file define the regexp for pre and build as well ? (Note that the above regexps are probably wrong)

pattern alphanumeric-identifier = string::regexp<"[a-Za-z0-9]">
pattern pre-release = alphanumeric-identifier
pattern build = alphanumeric-identifier

pattern semver = {
  major: integer,
  minor: integer,
  patch: integer,
  pre?: pre-release,
  build?: build,
}