Documentation
¶
Overview ¶
Package project turns the paths a user names — files, directories and glob patterns — into the model files to load, in a deterministic order.
Index ¶
Constants ¶
const Stdin = "-"
Stdin is the path that names standard input, by the convention that a lone "-" is read from the stream rather than from a file of that name. A file really called "-" is named as "./-".
const StdinName = "<stdin>"
StdinName is what a model read from standard input is called in diagnostics.
Variables ¶
This section is empty.
Functions ¶
func Dependencies ¶
Dependencies returns the model files, beside or below the named ones, that declare a root namespace an import of the named files begins with and none of them declares, then the files those imports lead to in turn. known reports the names another source declares — the standard library's root packages — so an import of one is not searched for. A named file that cannot be read or is standard input contributes nothing; the loader reports the former. The result is ordered as it was found and holds no file already named.
func Expand ¶
Expand turns the paths named on a command line (or at a %load prompt) into the model files to load: a directory contributes every model file under it, a pattern contributes the model files among its matches, and any other path is taken as named. Files come back in a deterministic order — the inputs in the order given, each directory walk and each pattern match sorted by path — and duplicates are dropped, so naming a file twice loads it once.
func IsModelFile ¶
IsModelFile reports whether path names a SysML or KerML model file.
func ModelFiles ¶
ModelFiles walks dir and returns every .sysml/.kerml file under it, sorted by path. Hidden directories are skipped, so a repository's .git or a build cache under a dot-directory contributes nothing. Symlinked directories are walked — a project may keep a shared library as a link — each at most once, so a cycle terminates.
Types ¶
This section is empty.