#api/syscall
The Language API provides functions for parsing code in various programming languages and listing supported languages.
Parses a piece of code using any of the supported SilverBullet languages.
Example:
local code = [
function hello() {
console.log("Hello, world!");
}
](
function hello() {
console.log("Hello, world!");
}
)
local tree = language.parseLanguage("javascript", [
function hello() {
console.log("Hello, world!");
}
](
function hello() {
console.log("Hello, world!");
}
))
print("Parsed syntax tree:", tree)
Lists all supported languages in fenced code blocks.
Example: ${language.listLanguages()}