Skip to content

speedapi/susc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License Version Downloads PRs and issues

SUS compiler

This repository contains the compiler and language server for the SUS description language. Install it with:

pip3 install susc

What is SpeedAPI?

It's a platform-agnostic API and serialization tool specifically geared towards high-throughput realtime applications. You can read more about its features here

Usage

Help

$ susc --help
# OR
$ python3 -m susc --help

Compiler

  • 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

Language server

  • Start language server: susc -s
  • Start language server in stdio mode: susc -si

Misc

  • Print file with syntax highlighting: susc -p source.sus
  • Explain a diagnostic code: susc -x 0010

Programmatic usage

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")