Changeset cf3da24


Ignore:
Timestamp:
Oct 10, 2023, 11:42:38 AM (8 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
4604bf5
Parents:
ee9ad40
Message:

Fixed up some whitespace. Pretty minor stuff mostly.

Location:
src
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/AST/Convert.cpp

    ree9ad40 rcf3da24  
    269269                        node->location,
    270270                        Type::StorageClasses( node->storage.val ),
    271             get<Type>().accept1( node->base ),
     271                        get<Type>().accept1( node->base ),
    272272                        LinkageSpec::Spec( node->linkage.val )
    273273                );
     
    567567        }
    568568
    569     const ast::WhenClause * visit( const ast::WhenClause * node ) override final {
     569        const ast::WhenClause * visit( const ast::WhenClause * node ) override final {
    570570                // There is no old-AST WhenClause, so this should never be called.
    571571                assert( !node );
     
    604604        }
    605605
    606     const ast::Stmt * visit( const ast::WaitUntilStmt * node ) override final {
    607         // There is no old-AST WaitUntilStmt, so this should never be called.
     606        const ast::Stmt * visit( const ast::WaitUntilStmt * node ) override final {
     607                // There is no old-AST WaitUntilStmt, so this should never be called.
    608608                assert( !node );
    609609                return nullptr;
     
    650650        }
    651651
    652     const ast::Stmt * visit( const ast::CorunStmt * node ) override final {
    653         // There is no old-AST CorunStmt, so this should never be called.
     652        const ast::Stmt * visit( const ast::CorunStmt * node ) override final {
     653                // There is no old-AST CorunStmt, so this should never be called.
    654654                assert( !node );
    655655                return nullptr;
     
    859859                // New workd:   one public type: node->result, plus node->underlyer only to support roundtrip conversion
    860860                //              preserving underlyer because the correct type for string literals is complicated to construct,
    861             //              and distinguishing a string from other literals using the type is hard to do accurately
     861                //              and distinguishing a string from other literals using the type is hard to do accurately
    862862                // Both worlds: the outer, expression-level type can change during resolution
    863863                //              for a string, that's char[k] before-resolve and char * after
     
    865865                //              for a string, that's char[k] always
    866866                // Both worlds: the "rep" field of a constant is the C source file fragment that compiles to the desired value
    867         //              for a string, that includes outer quotes, backslashes, et al cases from the Literals test
     867                //              for a string, that includes outer quotes, backslashes, et al cases from the Literals test
    868868                ConstantExpr *rslt = new ConstantExpr(Constant(
    869869                        get<Type>().accept1(node->underlyer),
     
    15241524                return strict_dynamic_cast< ast::Decl * >( node );
    15251525        }
    1526        
     1526
    15271527        ConverterOldToNew() = default;
    15281528        ConverterOldToNew(const ConverterOldToNew &) = delete;
     
    15871587        ast::Label make_label(const Label* old) {
    15881588                CodeLocation const & location =
    1589                     ( old->labelled ) ? old->labelled->location : CodeLocation();
     1589                        ( old->labelled ) ? old->labelled->location : CodeLocation();
    15901590                return ast::Label(
    15911591                        location,
     
    22462246        // TypeSubstitution shouldn't exist yet in old.
    22472247        ast::TypeSubstitution * convertTypeSubstitution(const TypeSubstitution * old) {
    2248                
    22492248                if (!old) return nullptr;
    22502249                if (old->empty()) return nullptr;
     
    22912290        ast::Expr * visitBaseExpr_SkipResultType( const Expression * old, ast::Expr * nw) {
    22922291
    2293                 nw->env    = convertTypeSubstitution(old->env);
     2292                nw->env = convertTypeSubstitution(old->env);
    22942293
    22952294                nw->extension = old->extension;
     
    28622861
    28632862        virtual void visit( const EnumInstType * old ) override final {
    2864                 ast::EnumInstType * ty; 
     2863                ast::EnumInstType * ty;
    28652864                if ( old->baseEnum ) {
    28662865                        ty = new ast::EnumInstType{
  • src/AST/Pass.hpp

    ree9ad40 rcf3da24  
    162162        const ast::FinallyClause *    visit( const ast::FinallyClause        * ) override final;
    163163        const ast::Stmt *             visit( const ast::SuspendStmt          * ) override final;
    164     const ast::WhenClause *       visit( const ast::WhenClause           * ) override final;
     164        const ast::WhenClause *       visit( const ast::WhenClause           * ) override final;
    165165        const ast::Stmt *             visit( const ast::WaitForStmt          * ) override final;
    166166        const ast::WaitForClause *    visit( const ast::WaitForClause        * ) override final;
    167     const ast::Stmt *             visit( const ast::WaitUntilStmt        * ) override final;
     167        const ast::Stmt *             visit( const ast::WaitUntilStmt        * ) override final;
    168168        const ast::Decl *             visit( const ast::WithStmt             * ) override final;
    169169        const ast::NullStmt *         visit( const ast::NullStmt             * ) override final;
     
    171171        const ast::Stmt *             visit( const ast::ImplicitCtorDtorStmt * ) override final;
    172172        const ast::Stmt *             visit( const ast::MutexStmt            * ) override final;
    173     const ast::Stmt *             visit( const ast::CorunStmt            * ) override final;
     173        const ast::Stmt *             visit( const ast::CorunStmt            * ) override final;
    174174        const ast::Expr *             visit( const ast::ApplicationExpr      * ) override final;
    175175        const ast::Expr *             visit( const ast::UntypedExpr          * ) override final;
  • src/AST/Print.cpp

    ree9ad40 rcf3da24  
    209209        }
    210210
    211     void print( const ast::WaitStmt * node ) {
     211        void print( const ast::WaitStmt * node ) {
    212212                if ( node->timeout_time ) {
    213213                        os << indent-1 << "timeout of:" << endl;
     
    860860        }
    861861
    862     virtual const ast::Stmt * visit( const ast::WaitUntilStmt * node ) override final {
     862        virtual const ast::Stmt * visit( const ast::WaitUntilStmt * node ) override final {
    863863                os << "Waituntil Statement" << endl;
    864864                indent += 2;
     
    866866                        clause->accept( *this );
    867867                }
    868         print(node);    // calls print( const ast::WaitStmt * node )
     868                // calls print( const ast::WaitStmt * node )
     869                print(node);
    869870                return node;
    870871        }
     
    922923        }
    923924
    924     virtual const ast::Stmt * visit( const ast::CorunStmt * node ) override final {
     925        virtual const ast::Stmt * visit( const ast::CorunStmt * node ) override final {
    925926                os << "Corun Statement" << endl;
    926927                os << indent << "... with Statement: ";
  • src/Concurrency/Corun.cpp

    ree9ad40 rcf3da24  
    4242
    4343    Stmt * postvisit( const CorunStmt * stmt ) {
    44         if ( !runnerBlockDecl ) 
     44        if ( !runnerBlockDecl )
    4545            SemanticError( stmt->location, "To use corun statements add #include <cofor.hfa>\n" );
    4646
    4747        if ( !stmt->stmt )
    4848            return nullptr;
    49        
     49
    5050        const CodeLocation & loc = stmt->location;
    5151        const string fnName = CorunFnNamer.newName();
     
    7676        // __CFA_corun_block_{ __CFA_corun_lambda_ };
    7777        Stmt * threadStart = new ExprStmt( loc,
    78             new UntypedExpr ( loc, 
     78            new UntypedExpr ( loc,
    7979                new NameExpr( loc, "?{}" ),
    8080                {
  • src/Concurrency/Corun.hpp

    ree9ad40 rcf3da24  
    1616#pragma once
    1717
    18 
    19 class Declaration;
    2018namespace ast {
    2119        class TranslationUnit;
  • src/main.cc

    ree9ad40 rcf3da24  
    346346                PASS( "Implement Concurrent Keywords", Concurrency::implementKeywords, transUnit );
    347347                PASS( "Fix Unique Ids", Validate::fixUniqueIds, transUnit );
    348         PASS( "Implement Corun", Concurrency::implementCorun, transUnit );
     348                PASS( "Implement Corun", Concurrency::implementCorun, transUnit );
    349349                PASS( "Hoist Control Declarations", ControlStruct::hoistControlDecls, transUnit );
    350350
Note: See TracChangeset for help on using the changeset viewer.