• Daniel Clifford's avatar
    [torque]: Implement structs · 1062ffb9
    Daniel Clifford authored
    Struct are bundles of value types. They are essentially just shorthand
    for passing around a group of individually defined values.
    
    Struct types are declared like this:
    
      struct A {
        x: Smi;
        y: int32;
      }
    
    and can be constructed explicitly like this:
    
      A{0, 0}
    
    Structs can be used wherever other types are used (e.g. variables,
    parameters, return values) except for parameter/return types of
    builtins and runtime functions.
    
    Struct use field access notation to set/get their values like this:
    
      let a: A = A{0, 0};
      let b: Smi = a.x;
      a.y = 0;
    
    Change-Id: I9fd36a6514c37882831256a49a50809c5db75b56
    Reviewed-on: https://chromium-review.googlesource.com/1122133
    Commit-Queue: Daniel Clifford <danno@chromium.org>
    Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#54501}
    1062ffb9
Name
Last commit
Last update
..
Torque.g4 Loading commit data...
Torque.interp Loading commit data...
Torque.tokens Loading commit data...
TorqueBaseListener.cpp Loading commit data...
TorqueBaseListener.h Loading commit data...
TorqueBaseVisitor.cpp Loading commit data...
TorqueBaseVisitor.h Loading commit data...
TorqueLexer.cpp Loading commit data...
TorqueLexer.h Loading commit data...
TorqueLexer.interp Loading commit data...
TorqueLexer.tokens Loading commit data...
TorqueListener.cpp Loading commit data...
TorqueListener.h Loading commit data...
TorqueParser.cpp Loading commit data...
TorqueParser.h Loading commit data...
TorqueVisitor.cpp Loading commit data...
TorqueVisitor.h Loading commit data...
ast-generator.cc Loading commit data...
ast-generator.h Loading commit data...
ast.h Loading commit data...
contextual.h Loading commit data...
declarable.cc Loading commit data...
declarable.h Loading commit data...
declaration-visitor.cc Loading commit data...
declaration-visitor.h Loading commit data...
declarations.cc Loading commit data...
declarations.h Loading commit data...
file-visitor.cc Loading commit data...
file-visitor.h Loading commit data...
global-context.h Loading commit data...
implementation-visitor.cc Loading commit data...
implementation-visitor.h Loading commit data...
parameter-difference.h Loading commit data...
scope.cc Loading commit data...
scope.h Loading commit data...
torque.cc Loading commit data...
type-oracle.h Loading commit data...
types.cc Loading commit data...
types.h Loading commit data...
utils.cc Loading commit data...
utils.h Loading commit data...