Module: Carbon::Core Private
- Defined in:
- lib/carbon/core.rb,
lib/carbon/core/int.rb,
lib/carbon/core/main.rb,
lib/carbon/core/void.rb,
lib/carbon/core/integer.rb,
lib/carbon/core/pointer.rb,
lib/carbon/core/integer/cast.rb,
lib/carbon/core/integer/math.rb,
lib/carbon/core/integer/misc.rb,
lib/carbon/core/integer/pole.rb,
lib/carbon/core/integer/ship.rb,
lib/carbon/core/integer/sign.rb,
lib/carbon/core/integer/type.rb,
lib/carbon/core/integer/zero.rb,
lib/carbon/core/pointer/cast.rb,
lib/carbon/core/pointer/math.rb,
lib/carbon/core/pointer/type.rb,
lib/carbon/core/pointer/access.rb,
lib/carbon/core/pointer/memory.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
The Carbon Core library. This is the library that is loaded for every program, and contains definitions that cannot be defined from within Carbon. The Carbon Core library is required for any Carbon program to function.
Defined Under Namespace
Modules: Integer, Main, Pointer, Void Classes: Int
Constant Summary collapse
- PATH =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
Pathname.new(File.("../core/core.clib", __FILE__))
- Ints =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
The integeral types that are defined in Carbon, and all information pertaining to them.
[ ["Carbon::Int64", "to-int64", :signed, 64], ["Carbon::UInt64", "to-uint64", :unsigned, 64], ["Carbon::Int32", "to-int32", :signed, 32], ["Carbon::UInt32", "to-uint32", :unsigned, 32], ["Carbon::Int16", "to-int16", :signed, 16], ["Carbon::UInt16", "to-uint16", :unsigned, 16], ["Carbon::Int8", "to-int8", :signed, 8], ["Carbon::UInt8", "to-uint8", :unsigned, 8], ["Carbon::Boolean", "to-bool", :unsigned, 1] ].map { |a| Int.new(Carbon::Type(a[0]), *a[1..-1]) }.deep_freeze!
Class Method Summary collapse
-
.define(*options) {|data| ... } ⇒ void
Defines an item on the core index.
- .define_main(build, pass) ⇒ Object private
-
.finalize ⇒ void
private
Finalizes the index by defining all of the types on it.
- .find ⇒ Object private
-
.index ⇒ Concrete::Index
private
The core index.
Class Method Details
.define(*options) {|data| ... } ⇒ void
This method returns an undefined value.
Defines an item on the core index.
34 35 36 |
# File 'lib/carbon/core.rb', line 34 def self.define(*, &block) index.define(*, &block) end |
.define_main(build, pass) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
49 50 51 |
# File 'lib/carbon/core.rb', line 49 def self.define_main(build, pass) Core::Main.define_main_function(build.module, build.index, pass) end |
.finalize ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
This method returns an undefined value.
Finalizes the index by defining all of the types on it.
42 43 44 45 46 47 |
# File 'lib/carbon/core.rb', line 42 def self.finalize @index = Concrete::Index.new Core::Integer.define_integer Core::Pointer.define_pointer index.finalize end |
.find ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
53 54 55 56 57 58 59 |
# File 'lib/carbon/core.rb', line 53 def self.find if PATH.exist? Concrete.load(PATH.read) else finalize.tap { |i| PATH.write(Concrete.dump(i)) } end end |
.index ⇒ Concrete::Index
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
The core index. This can either be loaded from a core library file or from the definitions in this library.
19 20 21 |
# File 'lib/carbon/core.rb', line 19 def self.index @index ||= find end |