project

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

View Source
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 "./-".

View Source
const StdinName = "<stdin>"

StdinName is what a model read from standard input is called in diagnostics.

Variables

This section is empty.

Functions

func Dependencies

func Dependencies(files []string, known func(name string) bool) []string

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

func Expand(inputs []string) ([]string, error)

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

func IsModelFile(path string) bool

IsModelFile reports whether path names a SysML or KerML model file.

func IsStdin

func IsStdin(path string) bool

IsStdin reports whether path names standard input.

func ModelFiles

func ModelFiles(dir string) ([]string, error)

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.

func ReadFile

func ReadFile(path string) (string, []byte, error)

ReadFile returns the contents of the model at path together with the name it is reported under, reading standard input when path names it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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