Skip to main content

module util::SemVer

rascal-0.40.16

Usage

import util::SemVer;

function satisfiesVersion

Semantic Versioning.

bool satisfiesVersion(str version, str rangeSet)

Check that a given version string satisfies a range-set as defined by: (See https://github.com/npm/node-semver):

range-set  ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range ::= hyphen | simple ( ' ' simple ) * | ''
hyphen ::= partial ' - ' partial
simple ::= primitive | partial | tilde | caret
primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial
partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr ::= 'x' | 'X' | '*' | nr
nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
tilde ::= '~' partial
caret ::= '^' partial
qualifier ::= ( '-' pre )? ( '+' build )?
pre ::= parts
build ::= parts
parts ::= part ( '.' part ) *
part ::= nr | [-0-9A-Za-z]+

function lessVersion

bool lessVersion(str version1, str version2)

function lessEqualVersion

bool lessEqualVersion(str version1, str version2)

function greaterVersion

bool greaterVersion(str version1, str version2)

function greaterEqualVersion

bool greaterEqualVersion(str version1, str version2)

function equalVersion

bool equalVersion(str version1, str version2)

function getRascalVersion

str getRascalVersion()

function getRascalRuntimeVersion

str getRascalRuntimeVersion()

function getRascalCompilerVersion

str getRascalCompilerVersion()

function getJavaRuntimeVersion

str getJavaRuntimeVersion()