This repository contains the compiler and language server for the SUS description language. Install it with:
pip3 install susc
It's a platform-agnostic API and serialization tool specifically geared towards high-throughput realtime applications. You can read more about its features here
$ susc --help
# OR
$ python3 -m susc --help
- Compile file(s):
susc source1.sus source2.sus
- Compile file, override output dir:
susc -o output source.sus
- Compile file, override output language:
susc -l ts source.sus
- Start language server:
susc -s
- Start language server in stdio mode:
susc -si
- Print file with syntax highlighting:
susc -p source.sus
- Explain a diagnostic code:
susc -x 0010
from susc import File
file = File()
# load file:
file.load_from_file("/path/to/file.sus")
# or
file.load_from_file(open("/path/to/file.sus"))
# or load text:
file.load_from_text("compound Test { a: Str; b: Str; }")
things, diagnostics = file.parse()
print(things)
print(diagnostics)
language = "ts"
file.write_output(language, "/path/to/output/dir")