funny

package module
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2021 License: Apache-2.0 Imports: 23 Imported by: 1

README

funny lang

A funny language interpreter written in golang.

It begins just for fun.

Target

To make creating dsl easily based on funny.

  • apitest dsl
  • api declare dsl

Installation

go install github.com/jerloo/funny/cmd/funny@latest

Usage


// funny.fun
// author: jerloo@gmail.com
// github: https://github.com/jerloo/funny

echoln('define a varible value 1')
a = 1

echoln('define b varible value 2')
b = 2

echoln('define c varible value a ')
c = a

echoln('a, b, c values: ')
echoln('a = ', a,', b = ',  b, ', c = ', c)

echoln('assert c equels 1')
assert(c == 1)

d = c + b

echoln('assert (d = c + b) === ', d)
assert(d == 3)

echoln('define a function ')
echoln('minus(a, b) {')
echoln('  return b - a')
echoln('}')

minus(a, b) {
  return b - a
}

e = minus(a, b)
echoln('minus(a, b) === ', e)
assert(e == 1)

if a > 0 {
  echoln('if a > 0')
}

fib(n) {
  if n < 2 {
    return n
  }
  return fib(n - 1) + fib(n - 2)
}

r = fib(1)
echoln(r)
r = fib(2)
echoln(r)
r = fib(3)
echoln(r)
r = fib(4)
echoln(r)
r = fib(5)
echoln(r)
r = fib(6)
echoln(r)
r = fib(7)
echoln(r)
r = fib(8)
echoln(r)

person = {
  name = 'jerloo'
  age = 10
}
assert(person.name == 'jerloo')
echoln(person.age)

Object() {
  return {
    name = 'jerloo'
    age = 10
    isAdult() {
      this.age = this.age + 5
      echoln('this.age ', this.age)
      return true
    }
  }
}

obj = Object()
assert(obj.name == 'jerloo')
obj.age = 20
assert(obj.age == 20)
assert(obj.isAdult())
echoln(obj.isAdult())
echoln(obj.age)

arrdemo = [1,2,3]
echoln(arrdemo[2])
assert(arrdemo[2]==3)

hashTest = 'i am string'
echoln(hashTest)
echoln('hash(i am string) => ', hash(hashTest))

echoln('max(10, 20) => ', max(10,20))

import 'funny.imported.fun'

echoln('uuid => ', uuid())

deepObj = {
  a = {
    b = {
      c = 1
    }
  }
}

echoln('deepObj.a =>', test.a)
echoln('deepObj.a.b =>', test.a.b)
echoln('deepObj.a.b.c =>', test.a.b.c)
$ funny --help

usage: funny [<flags>] [<script>]

funny lang

Flags:
  --help    Show context-sensitive help (also try --help-long and --help-man).
  --lexer   tokenizer script
  --parser  parser AST

Args:
  [<script>]  script file path

Todos

  • Fix many and many bugs
  • Fix scope
  • Fix echo
  • Add more builtin functions
  • Add tests
  • Fix import feature
  • Typings
  • module and package feature
  • module repo based on github
  • Add everything with(have) comment's feature
  • Chinese comments length

License

The MIT License (MIT)

Copyright (c) 2018 jerloo

Documentation

Index

Constants

View Source
const (
	STNewLine            = "NewLine"
	STVariable           = "Variable"
	STLiteral            = "Literal"
	STBinaryExpression   = "BinaryExpression"
	STSubExpression      = "SubExpression"
	STAssign             = "Assign"
	STBlock              = "Block"
	STList               = "List"
	STListAccess         = "ListAccess"
	STFunction           = "Function"
	STFunctionCall       = "FunctionCall"
	STImportFunctionCall = "Import"
	STIfStatement        = "IfStatement"
	STForStatement       = "ForStatement"
	STIterableExpression = "IterableExpression"
	STBreak              = "Break"
	STContinue           = "Continue"
	STReturn             = "Return"
	STField              = "Field"
	STBoolean            = "Boolean"
	STStringExpression   = "StringExpression"
	STComment            = "Comment"
)
View Source
const (
	LBrace      = "{"
	RBrace      = "}"
	LBracket    = "["
	RBracket    = "]"
	LParenthese = "("
	RParenthese = ")"
	EQ          = "="
	DOUBLE_EQ   = "=="
	PLUS        = "+"
	MINUS       = "-"
	TIMES       = "*"
	DEVIDE      = "/"
	Quote       = "\""
	GT          = ">"
	LT          = "<"
	GTE         = ">="
	LTE         = "<="
	NOTEQ       = "!="
	COMMA       = ","
	DOT         = "."
	EOF         = "EOF"
	INT         = "INT"
	NAME        = "NAME"
	STRING      = "STRING"

	IF       = "if"
	ELSE     = "else"
	TRUE     = "true"
	FALSE    = "false"
	FOR      = "for"
	AND      = "and"
	IN       = "in"
	NIL      = "nil"
	NOT      = "not"
	OR       = "or"
	RETURN   = "return"
	BREAK    = "break"
	CONTINUE = "continue"

	NEW_LINE = "\\n"
	COMMENT  = "comment"
)
View Source
const (
	// VERSION of funny
	VERSION = "0.0.2"
)

Variables

View Source
var BuiltinsDotFunny string
View Source
var (
	// FUNCTIONS all builtin functions
	FUNCTIONS = map[string]BuiltinFunction{
		"echo":          Echo,
		"echoln":        Echoln,
		"now":           Now,
		"b64en":         Base64Encode,
		"b64de":         Base64Decode,
		"assert":        Assert,
		"len":           Len,
		"md5":           Md5,
		"max":           Max,
		"min":           Min,
		"typeof":        Typeof,
		"uuid":          UUID,
		"httpreq":       HttpRequest,
		"env":           Env,
		"strjoin":       StrJoin,
		"strsplit":      StrSplit,
		"str":           Str,
		"int":           Int,
		"jwten":         JwtEncode,
		"jwtde":         JwtDecode,
		"sqlquery":      SqlQuery,
		"sqlexec":       SqlExec,
		"sqlexecfile":   SqlExecFile,
		"format":        FormatData,
		"dumpruntimes":  DumpRuntimes,
		"readtext":      ReadText,
		"writetext":     WriteText,
		"readjson":      ReadJson,
		"writejson":     WriteJson,
		"regexMatch":    RegexMatch,
		"regexMapMatch": RegexMapMatch,
		"regexMapValue": RegexMapValue,
		"sh":            Sh,
	}
)
View Source
var Keywords = map[string]string{
	"and":      "and",
	"else":     "else",
	"false":    "false",
	"for":      "for",
	"if":       "if",
	"in":       "in",
	"nil":      "nil",
	"not":      "not",
	"or":       "or",
	"return":   "return",
	"true":     "true",
	"break":    "break",
	"continue": "continue",
}

Functions

func Format

func Format(data []byte, contentFile string) string

func P

func P(keyword string, pos Position) error

P panic

func Typing

func Typing(data interface{}) string

Typing return the type name of one object

Types

type Assign

type Assign struct {
	Position Position
	Type     string

	Target Statement
	Value  Statement
}

Assign like a = 2

func (*Assign) GetPosition added in v0.2.0

func (l *Assign) GetPosition() Position

func (*Assign) String

func (a *Assign) String() string

type BinaryExpression

type BinaryExpression struct {
	Position Position
	Type     string

	Left     Statement
	Operator Token
	Right    Statement
}

BinaryExpression like a > 10

func (*BinaryExpression) GetPosition added in v0.2.0

func (l *BinaryExpression) GetPosition() Position

func (*BinaryExpression) String

func (b *BinaryExpression) String() string

type Block

type Block struct {
	Statements []Statement

	Position Position
	Type     string
}

Block contains many statments

func (*Block) EndPosition added in v0.2.0

func (b *Block) EndPosition() Position

func (*Block) Format

func (b *Block) Format(root bool) string

func (*Block) GetPosition added in v0.2.0

func (b *Block) GetPosition() Position

Position of Block

func (*Block) String

func (b *Block) String() string

type Boolen

type Boolen struct {
	Position Position
	Type     string

	Value bool
}

Boolen like true, false

func (*Boolen) GetPosition added in v0.2.0

func (l *Boolen) GetPosition() Position

func (*Boolen) String

func (b *Boolen) String() string

type Break

type Break struct {
	Position Position
	Type     string
}

Break like break in for

func (*Break) GetPosition added in v0.2.0

func (l *Break) GetPosition() Position

func (*Break) String

func (b *Break) String() string

type BuiltinFunction

type BuiltinFunction func(fn *Funny, args []Value) Value

BuiltinFunction function handler

type Comment

type Comment struct {
	Position Position
	Type     string

	Value string
}

Comment line for sth

func (*Comment) GetPosition added in v0.2.0

func (l *Comment) GetPosition() Position

func (*Comment) String

func (c *Comment) String() string

type Continue

type Continue struct {
	Position Position
	Type     string
}

Continue like continue in for

func (*Continue) GetPosition added in v0.2.0

func (l *Continue) GetPosition() Position

func (*Continue) String

func (b *Continue) String() string

type FORStatement

type FORStatement struct {
	Position Position
	Type     string

	Iterable IterableExpression
	Block    Block

	CurrentIndex Variable
	CurrentItem  Statement
}

FORStatement like for

func (*FORStatement) GetPosition added in v0.2.0

func (l *FORStatement) GetPosition() Position

func (*FORStatement) String

func (f *FORStatement) String() string

type Field

type Field struct {
	Position Position
	Type     string

	Variable Variable
	Value    Statement
}

Field like obj.age

func (*Field) GetPosition added in v0.2.0

func (l *Field) GetPosition() Position

func (*Field) String

func (f *Field) String() string

type Function

type Function struct {
	Position Position
	Type     string

	Name       string
	Parameters []Statement
	Body       *Block
}

Function like test(a, b){}

func (*Function) GetPosition added in v0.2.0

func (l *Function) GetPosition() Position

func (*Function) SignatureString

func (f *Function) SignatureString() string

func (*Function) String

func (f *Function) String() string

type FunctionCall

type FunctionCall struct {
	Position Position
	Type     string

	Name       string
	Parameters []Statement
}

FunctionCall like test(a, b)

func (*FunctionCall) GetPosition added in v0.2.0

func (l *FunctionCall) GetPosition() Position

func (*FunctionCall) String

func (c *FunctionCall) String() string

type Funny added in v0.2.1

type Funny struct {
	Vars      []Scope
	Functions map[string]BuiltinFunction

	Current Position
}

Funny the virtual machine of funny code

func NewFunny added in v0.2.1

func NewFunny() *Funny

Create a new funny with default settings

func NewFunnyWithScope added in v0.2.1

func NewFunnyWithScope(vars Scope) *Funny

NewFunnyWithScope create a new funny

func (*Funny) Assign added in v0.2.1

func (i *Funny) Assign(name string, val Value)

Assign assign one variable

func (*Funny) AssignField added in v0.2.1

func (i *Funny) AssignField(field *Field, val Value)

AssignField assign one field value

func (*Funny) Debug added in v0.2.1

func (i *Funny) Debug() bool

Debug get debug value

func (*Funny) EvalBlock added in v0.2.1

func (i *Funny) EvalBlock(block *Block) (Value, bool)

EvalBlock eval a block

func (*Funny) EvalDevide added in v0.2.1

func (i *Funny) EvalDevide(left, right Value) Value

EvalDevide /

func (*Funny) EvalDoubleEq added in v0.2.1

func (i *Funny) EvalDoubleEq(left, right Value) Value

EvalDoubleEq ==

func (*Funny) EvalEqual added in v0.2.1

func (i *Funny) EvalEqual(left, right Value) Value

EvalEqual ==

func (*Funny) EvalExpression added in v0.2.1

func (i *Funny) EvalExpression(expression Statement) Value

EvalExpression eval part that is expression

func (*Funny) EvalField added in v0.2.1

func (i *Funny) EvalField(item *Field) Value

EvalField person.age

func (*Funny) EvalForStatement added in v0.2.1

func (i *Funny) EvalForStatement(item *FORStatement) (Value, bool)

EvalForStatement eval for statement

func (*Funny) EvalFunction added in v0.2.1

func (i *Funny) EvalFunction(item Function, params []Value) (Value, bool)

EvalFunction eval function

func (*Funny) EvalFunctionCall added in v0.2.1

func (i *Funny) EvalFunctionCall(item *FunctionCall) (Value, bool)

EvalFunctionCall eval function call like test(a, b)

func (*Funny) EvalGt added in v0.2.1

func (i *Funny) EvalGt(left, right Value) Value

EvalGt >

func (*Funny) EvalGte added in v0.2.1

func (i *Funny) EvalGte(left, right Value) Value

EvalGte >=

func (*Funny) EvalIfStatement added in v0.2.1

func (i *Funny) EvalIfStatement(item *IFStatement) (Value, bool)

EvalIfStatement eval if statement

func (*Funny) EvalIn added in v0.2.1

func (i *Funny) EvalIn(leftValue Value, right Statement) Value

func (*Funny) EvalLt added in v0.2.1

func (i *Funny) EvalLt(left, right Value) Value

EvalLt <

func (*Funny) EvalLte added in v0.2.1

func (i *Funny) EvalLte(left, right Value) Value

EvalLte <=

func (*Funny) EvalMinus added in v0.2.1

func (i *Funny) EvalMinus(left, right Value) Value

EvalMinus -

func (*Funny) EvalPlus added in v0.2.1

func (i *Funny) EvalPlus(left, right Value) Value

EvalPlus +

func (*Funny) EvalStatement added in v0.2.1

func (i *Funny) EvalStatement(item Statement) (Value, bool)

EvalStatement eval statement

func (*Funny) EvalTimes added in v0.2.1

func (i *Funny) EvalTimes(left, right Value) Value

EvalTimes *

func (*Funny) Lookup added in v0.2.1

func (i *Funny) Lookup(name string) Value

Lookup find one variable named name and get value

func (*Funny) LookupDefault added in v0.2.1

func (i *Funny) LookupDefault(name string, defaultVal Value) Value

LookupDefault find one variable named name and get value, if not found, return default

func (*Funny) PopScope added in v0.2.1

func (i *Funny) PopScope()

PopScope pop current scope

func (*Funny) PushScope added in v0.2.1

func (i *Funny) PushScope(scope Scope)

PushScope push scope into current

func (*Funny) RegisterFunction added in v0.2.1

func (i *Funny) RegisterFunction(name string, fn BuiltinFunction) error

RegisterFunction register a builtin or customer function

func (*Funny) Run added in v0.2.1

func (i *Funny) Run(v interface{}) (Value, bool)

Run the part of the code

func (*Funny) RunFile added in v0.2.1

func (i *Funny) RunFile(filename string) (Value, bool)

type FunnyRuntimeError

type FunnyRuntimeError struct {
	Postion Position
	Msg     string
}

func (*FunnyRuntimeError) Error

func (fre *FunnyRuntimeError) Error() string

type IFStatement

type IFStatement struct {
	Position Position
	Type     string

	Condition Statement
	Body      *Block
	Else      *Block
	ElseIf    Statement
}

IFStatement like if

func (*IFStatement) GetPosition added in v0.2.0

func (l *IFStatement) GetPosition() Position

func (*IFStatement) String

func (i *IFStatement) String() string

type ImportFunctionCall

type ImportFunctionCall struct {
	Position Position
	Type     string

	ModulePath string
	Block      *Block
}

ImportFunctionCall like test(a, b)

func (*ImportFunctionCall) GetPosition added in v0.2.0

func (l *ImportFunctionCall) GetPosition() Position

func (*ImportFunctionCall) String

func (c *ImportFunctionCall) String() string

type IterableExpression

type IterableExpression struct {
	Position Position
	Type     string

	Name  Variable
	Index int
	Items []Statement
}

IterableExpression like for in

func (*IterableExpression) GetPosition added in v0.2.0

func (l *IterableExpression) GetPosition() Position

func (*IterableExpression) Next

func (i *IterableExpression) Next() (int, Statement)

Next part of IterableExpression

func (*IterableExpression) String

func (i *IterableExpression) String() string

type Lexer

type Lexer struct {
	Offset     int
	CurrentPos Position

	SaveOffset int
	SavePos    Position
	Data       []byte
	Elements   []Token

	File string
}

Lexer the lexer

func NewLexer

func NewLexer(data []byte, file string) *Lexer

NewLexer create a new lexer

func (*Lexer) Consume

func (l *Lexer) Consume(n int) rune

Consume next char and move position

func (*Lexer) CreateToken

func (l *Lexer) CreateToken(kind string) Token

CreateToken create a new token and move position

func (*Lexer) LA

func (l *Lexer) LA(n int) rune

LA next char

func (*Lexer) NewLine

func (l *Lexer) NewLine() Token

NewLine move to next line

func (*Lexer) Next

func (l *Lexer) Next() Token

Next get next token

func (*Lexer) ReadComments

func (l *Lexer) ReadComments() Token

ReadComments read comments

func (*Lexer) ReadInt

func (l *Lexer) ReadInt() Token

ReadInt get a into from current position

func (*Lexer) ReadString

func (l *Lexer) ReadString() Token

ReadString read next string token

func (*Lexer) Reset

func (l *Lexer) Reset()

Reset reset the position

type List

type List struct {
	Position Position
	Type     string

	Values []Statement
}

List like [1, 2, 3]

func (*List) GetPosition added in v0.2.0

func (l *List) GetPosition() Position

func (*List) String

func (l *List) String() string

type ListAccess

type ListAccess struct {
	Position Position
	Type     string

	Index int
	List  Variable
}

ListAccess like a[0]

func (*ListAccess) GetPosition added in v0.2.0

func (l *ListAccess) GetPosition() Position

func (*ListAccess) String

func (l *ListAccess) String() string

type Literal

type Literal struct {
	Position Position
	Type     string

	Value interface{}
}

Literal like 1

func (*Literal) GetPosition added in v0.2.0

func (v *Literal) GetPosition() Position

func (*Literal) String

func (l *Literal) String() string

type NewLine

type NewLine struct {
	Position Position
	Type     string
}

NewLine @impl Statement \n

func (*NewLine) EndPosition added in v0.2.0

func (n *NewLine) EndPosition() Position

func (*NewLine) GetPosition added in v0.2.0

func (n *NewLine) GetPosition() Position

func (*NewLine) String

func (n *NewLine) String() string

type Parser

type Parser struct {
	Lexer   *Lexer
	Current Token

	Tokens []Token

	ContentFile string
}

Parser the parser

func NewParser

func NewParser(data []byte, file string) *Parser

NewParser create a new parser

func (*Parser) Consume

func (p *Parser) Consume(kind string) Token

Consume get next token

func (*Parser) Parse

func (p *Parser) Parse() (block *Block, err error)

Parse parse to statements

func (*Parser) ReadDict

func (p *Parser) ReadDict() Statement

ReadDict read dict expression

func (*Parser) ReadExpression

func (p *Parser) ReadExpression() Statement

ReadExpression read next expression

func (*Parser) ReadFOR

func (p *Parser) ReadFOR() Statement

ReadFOR read for statement

func (*Parser) ReadField

func (p *Parser) ReadField() Statement

ReadField read field expression

func (*Parser) ReadFunction

func (p *Parser) ReadFunction(name string) Statement

ReadFunction read function statement

func (*Parser) ReadFunctionCall added in v0.2.7

func (p *Parser) ReadFunctionCall(name string) Statement

ReadFunctionCall read function statement

func (*Parser) ReadIF

func (p *Parser) ReadIF() Statement

ReadIF get next if statement

func (*Parser) ReadList

func (p *Parser) ReadList() Statement

ReadList read list expression

func (*Parser) ReadStatement

func (p *Parser) ReadStatement() Statement

ReadStatement get next statement

type Position

type Position struct {
	File   string
	Line   int
	Col    int
	Length int
}

Position of one token

func (*Position) String

func (p *Position) String() string

String of one token

type Program

type Program struct {
	Statements *Block
}

Program means the whole application

func (*Program) String

func (p *Program) String() string

type Return

type Return struct {
	Position Position
	Type     string

	Value Statement
}

Return like return varA

func (*Return) GetPosition added in v0.2.0

func (l *Return) GetPosition() Position

func (*Return) String

func (r *Return) String() string

type Scope

type Scope map[string]Value

Scope stores variables

type Statement

type Statement interface {
	String() string
	GetPosition() Position
}

Statement abstract

type StringExpression

type StringExpression struct {
	Position Position
	Type     string

	Value string
}

StringExpression like 'hello world !'

func (*StringExpression) GetPosition added in v0.2.0

func (l *StringExpression) GetPosition() Position

func (*StringExpression) String

func (s *StringExpression) String() string

type SubExpression added in v0.2.7

type SubExpression struct {
	Position Position
	Type     string

	Expression Statement
}

SubExpression like a = a && (b * 3), and then '(b * 3)' is SubExpression

func (*SubExpression) GetPosition added in v0.2.7

func (l *SubExpression) GetPosition() Position

func (*SubExpression) String added in v0.2.7

func (b *SubExpression) String() string

type Token

type Token struct {
	Position Position
	Kind     string
	Data     string
}

Token a part of code

func (Token) String

func (t Token) String() string

type Value

type Value interface {
}

Value one value of some like variable

func Assert

func Assert(fn *Funny, args []Value) Value

Assert return the value that has been given

func Base64Decode

func Base64Decode(fn *Funny, args []Value) Value

Base64Decode return base64 decoded string

func Base64Encode

func Base64Encode(fn *Funny, args []Value) Value

Base64Encode return base64 encoded string

func DumpRuntimes added in v0.2.0

func DumpRuntimes(fn *Funny, args []Value) Value

DumpRuntimes dumpruntimes()

func Echo

func Echo(fn *Funny, args []Value) Value

Echo builtin function echos one or every item in a array

func Echoln

func Echoln(fn *Funny, args []Value) Value

Echoln builtin function echos one or every item in a array

func Env

func Env(fn *Funny, args []Value) Value

Env return the value of env key

func FormatData added in v0.2.0

func FormatData(fn *Funny, args []Value) Value

FormatData format(data, formatStr) string

func HttpRequest

func HttpRequest(fn *Funny, args []Value) Value

HttpRequest builtin function for http request

func Int

func Int(fn *Funny, args []Value) Value

Int like int('1')

func JwtDecode

func JwtDecode(fn *Funny, args []Value) Value

JwtDecode jwtde(method, secret, token) string

func JwtEncode

func JwtEncode(fn *Funny, args []Value) Value

JwtEncode jwten(method, secret, claims) string

func Len

func Len(fn *Funny, args []Value) Value

Len return then length of the given list

func Max

func Max(fn *Funny, args []Value) Value

Max return then length of the given list

func Md5

func Md5(fn *Funny, args []Value) Value

Md5 return then length of the given list

func Min

func Min(fn *Funny, args []Value) Value

Min return then length of the given list

func Now

func Now(fn *Funny, args []Value) Value

Now builtin function return now time

func ReadJson added in v0.2.0

func ReadJson(fn *Funny, args []Value) Value

ReadJson readjson(filename)

func ReadText added in v0.2.0

func ReadText(fn *Funny, args []Value) Value

ReadText readtext()

func RegexMapMatch added in v0.2.6

func RegexMapMatch(fn *Funny, args []Value) Value

RegexMapMatch regexMapMatch(regexMap, text)

func RegexMapValue added in v0.2.6

func RegexMapValue(fn *Funny, args []Value) Value

RegexMapValue regexMapValue(regexMap, text)

func RegexMatch added in v0.2.6

func RegexMatch(fn *Funny, args []Value) Value

RegexMatch regexMatch(regex, text)

func Sh added in v0.2.6

func Sh(fn *Funny, args []Value) Value

Sh sh(command)

func SqlExec

func SqlExec(fn *Funny, args []Value) Value

SqlExec sqlexec(connection, sqlRaw, args) string

func SqlExecFile added in v0.2.0

func SqlExecFile(fn *Funny, args []Value) Value

SqlExecFile sqlexecfile(connection, file)

func SqlQuery

func SqlQuery(fn *Funny, args []Value) Value

SqlQuery sqlquery(connection, sqlRaw, args) string

func Str

func Str(fn *Funny, args []Value) Value

Str like string(1)

func StrJoin

func StrJoin(fn *Funny, args []Value) Value

StrJoin equal strings.Join

func StrSplit

func StrSplit(fn *Funny, args []Value) Value

StrSplit equal strings.Split

func Typeof

func Typeof(fn *Funny, args []Value) Value

Typeof builtin function echos one or every item in a array

func UUID

func UUID(fn *Funny, args []Value) Value

UUID builtin function return a uuid string value

func WriteJson added in v0.2.0

func WriteJson(fn *Funny, args []Value) Value

WriteJson writejson(filename, obj)

func WriteText added in v0.2.0

func WriteText(fn *Funny, args []Value) Value

WriteText writetext(text)

type Variable

type Variable struct {
	Position Position
	Type     string

	Name string
}

Variable means var

func (*Variable) GetPosition added in v0.2.0

func (v *Variable) GetPosition() Position

func (*Variable) String

func (v *Variable) String() string

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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