lang

package
v1.2.14 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LangDic map[string]Lang = map[string]Lang{}

language dictionary

View Source
var LangSlice = []string{"c", "c++", "c++17", "go", "python3"}
View Source
var OriginLangDic map[string]ExportLang = map[string]ExportLang{
	"c": {
		IsComplieLang:  true,
		CompileCommand: "gcc $codefile -o cat",
		RunCommand:     "./cat",
		ProgramTypeId:  "43",
		Codefile:       "dew.c",
		Name:           "GNU GCC C11 5.1.0",
	},
	"c++": {
		IsComplieLang:  true,
		CompileCommand: "g++ $codefile -o cat",
		RunCommand:     "./cat",
		ProgramTypeId:  "61",
		Codefile:       "dew.cpp",
		Name:           "GNU G++17 9.2.0 (64 bit, msys 2)",
	},
	"c++17": {
		IsComplieLang:  true,
		CompileCommand: "g++ $codefile -o cat -std=c++17",
		RunCommand:     "./cat",
		ProgramTypeId:  "54",
		Codefile:       "dew.cpp",
		Name:           "GNU G++17 7.3.0",
	},
	"go": {
		IsComplieLang:  true,
		CompileCommand: "go build -o cat $codefile",
		RunCommand:     "./cat",
		ProgramTypeId:  "32",
		Codefile:       "dew.go",
		Name:           "Go 1.19",
	},
	"python3": {
		IsComplieLang:  false,
		CompileCommand: " ",
		RunCommand:     "python3 $codefile",
		ProgramTypeId:  "31",
		Codefile:       "dew.py",
		Name:           "Python 3.8.10",
	},
}

Functions

func ImportLangDic

func ImportLangDic()

Types

type ExportLang

type ExportLang struct {
	IsComplieLang  bool   `json:"isCompileLang"`
	CompileCommand string `json:"compileCommand"`
	RunCommand     string `json:"runCommand"`
	ProgramTypeId  string `json:"programTypeId"`
	Codefile       string `json:"codefile"`
	Name           string `json:"name"`
}

type Lang

type Lang struct {
	IsComplieLang bool

	// compile file name must is cat
	CompileCode func(codefile string) *exec.Cmd
	RunCode     func(codefile string) *exec.Cmd

	ProgramTypeId string
	Codefile      string
	Name          string
}

Jump to

Keyboard shortcuts

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