Documentation ¶
Overview ¶
* * Copyright 2022 indentlang authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *
* * Copyright 2022 indentlang authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *
* * Copyright 2022 indentlang authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *
* * Copyright 2022 indentlang authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *
* * Copyright 2022 indentlang authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *
Index ¶
- Variables
- func ForEach(it Iterable, action func(Object) bool)
- type Appliable
- type BaseEnvironment
- func (b BaseEnvironment) CopyTo(other Environment)
- func (b BaseEnvironment) Delete(key Object)
- func (b BaseEnvironment) DeleteStr(key string)
- func (b BaseEnvironment) Iter() Iterator
- func (b BaseEnvironment) Load(key Object) Object
- func (b BaseEnvironment) LoadStr(key string) (Object, bool)
- func (b BaseEnvironment) Size() int
- func (b BaseEnvironment) Store(key, value Object)
- func (b BaseEnvironment) StoreStr(key string, value Object)
- type Boolean
- type ConvertString
- type DataEnvironment
- type Environment
- type Float
- type Identifier
- type Integer
- type Iterable
- type Iterator
- type List
- func (l *List) Add(value Object)
- func (l *List) AddAll(it Iterable) *List
- func (l *List) AddCategory(category string)
- func (l *List) CopyCategories() map[string]NoneType
- func (l *List) Eval(env Environment) Object
- func (l *List) HasCategory(category string) bool
- func (l *List) ImportCategories(other *List)
- func (l *List) Iter() Iterator
- func (l *List) Load(key Object) Object
- func (l *List) LoadInt(index int) Object
- func (l *List) Size() int
- func (l *List) Store(key Object, value Object)
- func (l *List) WriteTo(w io.Writer) (int64, error)
- type LoadWrapper
- type Loadable
- type LocalEnvironment
- type MergeEnvironment
- func (m MergeEnvironment) CopyTo(other Environment)
- func (m MergeEnvironment) Delete(key Object)
- func (m MergeEnvironment) DeleteStr(key string)
- func (m MergeEnvironment) Load(key Object) Object
- func (m MergeEnvironment) LoadStr(key string) (Object, bool)
- func (m MergeEnvironment) Store(key, value Object)
- func (m MergeEnvironment) StoreStr(key string, value Object)
- type NativeAppliable
- type NoneType
- type Object
- type Sizable
- type Storable
- type String
- type StringLoadable
Constants ¶
This section is empty.
Variables ¶
var None = NoneType{}
Functions ¶
Types ¶
type Appliable ¶
type Appliable interface { Object Apply(Environment, Iterable) Object ApplyWithData(any, Environment, Iterable) Object }
type BaseEnvironment ¶
type BaseEnvironment struct { NoneType // contains filtered or unexported fields }
func MakeBaseEnvironment ¶
func MakeBaseEnvironment() BaseEnvironment
func (BaseEnvironment) CopyTo ¶
func (b BaseEnvironment) CopyTo(other Environment)
func (BaseEnvironment) Delete ¶
func (b BaseEnvironment) Delete(key Object)
func (BaseEnvironment) DeleteStr ¶
func (b BaseEnvironment) DeleteStr(key string)
func (BaseEnvironment) Iter ¶
func (b BaseEnvironment) Iter() Iterator
func (BaseEnvironment) Load ¶
func (b BaseEnvironment) Load(key Object) Object
func (BaseEnvironment) Size ¶
func (b BaseEnvironment) Size() int
func (BaseEnvironment) Store ¶
func (b BaseEnvironment) Store(key, value Object)
func (BaseEnvironment) StoreStr ¶
func (b BaseEnvironment) StoreStr(key string, value Object)
type Boolean ¶
type Boolean bool
func (Boolean) Eval ¶
func (b Boolean) Eval(env Environment) Object
type ConvertString ¶
type DataEnvironment ¶
type DataEnvironment struct { Environment // contains filtered or unexported fields }
func MakeDataEnvironment ¶ added in v1.0.1
func MakeDataEnvironment(data any, env Environment) DataEnvironment
func (DataEnvironment) Load ¶
func (d DataEnvironment) Load(key Object) Object
type Environment ¶
type Environment interface { Object Storable Delete(Object) StringLoadable StoreStr(string, Object) DeleteStr(string) CopyTo(Environment) }
type Identifier ¶
type Identifier string
func (Identifier) Eval ¶
func (i Identifier) Eval(env Environment) Object
type Integer ¶
type Integer int64
func (Integer) Eval ¶
func (i Integer) Eval(env Environment) Object
type List ¶
type List struct {
// contains filtered or unexported fields
}
func (*List) AddCategory ¶
func (*List) CopyCategories ¶
func (*List) Eval ¶
func (l *List) Eval(env Environment) Object
func (*List) HasCategory ¶
func (*List) ImportCategories ¶
type LoadWrapper ¶
type LoadWrapper struct { NoneType // contains filtered or unexported fields }
func (LoadWrapper) Load ¶
func (w LoadWrapper) Load(key Object) Object
type LocalEnvironment ¶
type LocalEnvironment struct { BaseEnvironment // contains filtered or unexported fields }
func MakeLocalEnvironment ¶ added in v1.0.1
func MakeLocalEnvironment(env Environment) LocalEnvironment
func (LocalEnvironment) Load ¶
func (l LocalEnvironment) Load(key Object) Object
type MergeEnvironment ¶
type MergeEnvironment struct { NoneType // contains filtered or unexported fields }
Read only : all non Load* methods ore no-op.
func MakeMergeEnvironment ¶ added in v1.0.1
func MakeMergeEnvironment(creationEnv, callEnv Environment) MergeEnvironment
func (MergeEnvironment) CopyTo ¶
func (m MergeEnvironment) CopyTo(other Environment)
func (MergeEnvironment) Delete ¶
func (m MergeEnvironment) Delete(key Object)
func (MergeEnvironment) DeleteStr ¶
func (m MergeEnvironment) DeleteStr(key string)
func (MergeEnvironment) Load ¶
func (m MergeEnvironment) Load(key Object) Object
func (MergeEnvironment) Store ¶
func (m MergeEnvironment) Store(key, value Object)
func (MergeEnvironment) StoreStr ¶
func (m MergeEnvironment) StoreStr(key string, value Object)
type NativeAppliable ¶
type NativeAppliable struct { NoneType // contains filtered or unexported fields }
func MakeNativeAppliable ¶
func MakeNativeAppliable(f func(Environment, Iterator) Object) NativeAppliable
func (NativeAppliable) Apply ¶
func (n NativeAppliable) Apply(env Environment, it Iterable) Object
func (NativeAppliable) ApplyWithData ¶
func (n NativeAppliable) ApplyWithData(data any, env Environment, it Iterable) Object
type NoneType ¶
type NoneType struct{}
func (NoneType) Eval ¶
func (n NoneType) Eval(env Environment) Object
type Object ¶
type Object interface { io.WriterTo Eval(Environment) Object }
func Load ¶
func Load(env StringLoadable, key Object) Object