Class: Dhall::Operator

Inherits:
Expression show all
Defined in:
lib/dhall/ast.rb,
lib/dhall/binary.rb,
lib/dhall/normalize.rb

Defined Under Namespace

Modules: FetchFromMerge Classes: And, Equal, Equivalent, ImportFallback, ListConcatenate, NotEqual, Or, Plus, RecursiveRecordMerge, RecursiveRecordTypeMerge, RightBiasedRecordMerge, TextConcatenate, Times

Constant Summary collapse

OPERATORS =
[
	Or, And, Equal, NotEqual,
	Plus, Times,
	TextConcatenate, ListConcatenate,
	RecursiveRecordMerge, RightBiasedRecordMerge, RecursiveRecordTypeMerge,
	ImportFallback,
	Equivalent
].freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Expression

#&, #*, #+, #annotate, #as_dhall, #cache_key, #call, #concat, #deep_merge, #deep_merge_type, #dhall_eq, #digest, #fetch, #fusion, #merge, #normalize, #resolve, #shift, #slice, #substitute, #to_binary, #to_cbor, #to_proc, #to_s, #|

Class Method Details

.decode(opcode, lhs, rhs) ⇒ Object



78
79
80
81
82
83
# File 'lib/dhall/binary.rb', line 78

def self.decode(opcode, lhs, rhs)
	OPERATORS[opcode].new(
		lhs: Dhall.decode(lhs),
		rhs: Dhall.decode(rhs)
	)
end

Instance Method Details

#as_jsonObject



350
351
352
# File 'lib/dhall/ast.rb', line 350

def as_json
	[3, OPERATORS.index(self.class), lhs.as_json, rhs.as_json]
end