Skip to content

apexlang/apex-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8aa9afe · Apr 26, 2025

History

21 Commits
Apr 26, 2025
Feb 4, 2024
Apr 26, 2025
Feb 4, 2024
Feb 4, 2024
Feb 4, 2024
Feb 4, 2024
Apr 26, 2025
Feb 4, 2024
Apr 26, 2025
Feb 4, 2024
Jan 21, 2023
Sep 30, 2022
Apr 26, 2025
Feb 21, 2022
Apr 26, 2025
Apr 26, 2025
Apr 26, 2025
Feb 4, 2024
Apr 26, 2025

Repository files navigation

Apex Language support for Golang

TODO

package main

import (
	"encoding/json"
	"fmt"
	"os"

	"github.com/apexlang/apex-go/parser"
)

func main() {
	schema, err := os.ReadFile("schema.apex")
	if err != nil {
		panic(err)
	}
	doc, err := parser.Parse(parser.ParseParams{
		Source: string(schema),
		Options: parser.ParseOptions{
			NoLocation: true,
			NoSource:   true,
		},
	})
	if err != nil {
		panic(err)
	}

	jsonBytes, err := json.MarshalIndent(doc, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(jsonBytes))
}