Module: Fusion

Defined in:
lib/fusion/null.rb,
lib/fusion.rb,
lib/fusion/ast.rb,
lib/fusion/cli.rb,
lib/fusion/atom.rb,
lib/fusion/lexer.rb,
lib/fusion/token.rb,
lib/fusion/parser.rb,
lib/fusion/version.rb,
lib/fusion/cli/repl.rb,
lib/fusion/wire_pair.rb,
lib/fusion/cli/parser.rb,
lib/fusion/cli/decoder.rb,
lib/fusion/cli/encoder.rb,
lib/fusion/cli/options.rb,
lib/fusion/interpreter.rb,
lib/fusion/cli/serializer.rb,
lib/fusion/interpreter/env.rb,
lib/fusion/interpreter/func.rb,
lib/fusion/interpreter/builtins.rb,
lib/fusion/interpreter/error_val.rb,
lib/fusion/interpreter/file_thunk.rb,
lib/fusion/interpreter/native_func.rb

Overview

Interpreter internals ===

A native (Ruby-implemented) function. Apply treats it like a Func.

Defined Under Namespace

Modules: AST, CLI Classes: FusionError, Interpreter, Lexer, ParseError, Parser, Unreachable

Constant Summary collapse

Atom =

A scalar literal value: the JSON atoms plus NULL (everything the lexer emits as a token value, see Lexer#lex_number and #lex_word).

->(v) {
  v == NULL ||  v == true || v == false ||
    v.is_a?(Integer) || v.is_a?(Float) || v.is_a?(String)
}
NULL =
:null
Token =

type: one of the lexer’s token-type symbols (:number, :ident, :lparen, …). value: the token’s payload — a scalar for literals/keywords, the matched

text for punctuation/identifiers, or nil for :eof.

pos: the token’s source offset.

TypedData.define(
  type: Symbol,
  value: ->(v) { Atom === v || v.nil? },
  pos: Integer,
)
VERSION =
"0.0.1.alpha2"
WirePair =
TypedData.define(status: ->(v) { Integer === v && [0, 1].include?(v) }, data: String)