rkw

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndEscapeName

func CheckAndEscapeName(name string, scope string) string

CheckAndEscapeName checks if the given name is a reserved keyword in any language and returns the escaped version of the name if it is.

func CheckIsReserved added in v0.38.0

func CheckIsReserved(langs []Lang, name string, scope string)

CheckIsReserved checks if the given name is a reserved keyword in any language and logs a warning if it is

func EscapeKeyword

func EscapeKeyword(word string) string

EscapeKeyword returns the escaped version of the given word

func IsKeywordReservedInLang

func IsKeywordReservedInLang(lang Lang, word string) bool

IsKeywordReservedInLang returns true if the word is a reserved keyword in the given language

Types

type Lang

type Lang string

Lang represents a programming language

const (
	CPP Lang = "cpp" // C++
	PY  Lang = "py"  // Python
	TS  Lang = "ts"  // TypeScript
	JS  Lang = "js"  // JavaScript
	GO  Lang = "go"  // Go
	UE  Lang = "ue"  // Unreal Engine C++
	QT  Lang = "qt"  // Qt C++
)

func IsKeywordInLangs added in v0.38.0

func IsKeywordInLangs(langs []Lang, word string) (Lang, bool)

func IsKeywordReserved

func IsKeywordReserved(word string) ([]Lang, bool)

IsKeywordReserved returns true if the word is a reserved keyword in any language and returns the list of languages in which the word is a reserved keyword

func (Lang) DisplayName

func (l Lang) DisplayName() string

DisplayName returns the display name of the language

Jump to

Keyboard shortcuts

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