• Daniel Clifford's avatar
    Refactor/cleanup various Torque classes, inclduing making Type a Declarable · 90415437
    Daniel Clifford authored
    This is a preparatory step for implementing generics. Along the way, clean up
    and encapsulate a bunch of code, including:
    
    * Fully encapsulate Scope by adding the new class ScopeChain that provide an
      abstraction for creating and activating scopes.
    * Untangle Modules and Scopes.
    * Unify scope activation so that it is always associated with an AST node
      and triggered by a RAII helper class.
    * Unify (somewhat) how builtins and macros are created, fixing a few
      inconsistencies with when and how parameters and their types are declared.
    * Create a new Declarations class that brokers between the visitor classes and
      the ScopeChain. This moves handling of declaration-related errors out of the
      visitors but also makes it possible to do so without polluting Scope and
      ScopeChain with details about resolving SourcePositions in error cases.
    
    Change-Id: I180017d4cf39ccf5ef1d20b84f53284c252f8d87
    Reviewed-on: https://chromium-review.googlesource.com/1038504
    Commit-Queue: Daniel Clifford <danno@chromium.org>
    Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#52947}
    90415437
scope.cc 1.26 KB