parsing

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 20, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NormalizeVersion

func NormalizeVersion(v string) (semver.Version, error)

This function takes a version string and returns a semantic version representation. If the string is not, itself, in semantic version form, a set of rules will be used to try and cast it into that form.

func ParseName added in v0.8.1

func ParseName(pkg string) (string, error)

func ParseUses

func ParseUses(code string) (map[string]semver.Version, error)

This function parses a string that represents Modelica code and extracts all the libraries that it uses (along with their version numbers). Sadly, one of Go's main weakness is its ability to built compiler compilers which makes creating a real Modelica parser problematic. :-(

func SimpleVersion

func SimpleVersion(v string) string

This function takes a potential complex version string like 1.5-build.3 and returns just the version part (no build or pre-release strings). Since we may be dealing with legacy version numbers, we cannot assume such a version string is a semantic version. So basically, we cut the string off at the first non-numeric non-. character.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL