Changeset bcd74f3 for src


Ignore:
Timestamp:
May 8, 2020, 4:44:53 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
5c9b20c
Parents:
e3bc51c (diff), 0e7e3c17 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into new-ast

Location:
src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • src/CompilationState.cc

    re3bc51c rbcd74f3  
    2727        nopreludep = false,
    2828        genproto = false,
     29        deterministic_output = false,
    2930        nomainp = false,
    3031        parsep = false,
  • src/CompilationState.h

    re3bc51c rbcd74f3  
    2828        nopreludep,
    2929        genproto,
     30        deterministic_output,
    3031        nomainp,
    3132        parsep,
  • src/Parser/parser.yy

    re3bc51c rbcd74f3  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Mar  6 17:26:45 2020
    13 // Update Count     : 4474
     12// Last Modified On : Mon Apr 27 12:25:42 2020
     13// Update Count     : 4483
    1414//
    1515
     
    966966
    967967tuple_expression_list:
    968         assignment_expression_opt
    969         | tuple_expression_list ',' assignment_expression_opt
     968        assignment_expression
     969        | '@'                                                                                           // CFA
     970                { SemanticError( yylloc, "Eliding tuple element with '@' is currently unimplemented." ); $$ = nullptr; }
     971        | tuple_expression_list ',' assignment_expression
    970972                { $$ = (ExpressionNode *)($1->set_last( $3 )); }
     973        | tuple_expression_list ',' '@'
     974                { SemanticError( yylloc, "Eliding tuple element with '@' is currently unimplemented." ); $$ = nullptr; }
    971975        ;
    972976
  • src/ResolvExpr/TypeEnvironment.cc

    re3bc51c rbcd74f3  
    2020#include <utility>                     // for pair, move
    2121
     22#include "CompilationState.h"          // for deterministic_output
    2223#include "Common/utility.h"            // for maybeClone
    2324#include "SynTree/Type.h"              // for Type, FunctionType, Type::Fora...
     
    106107
    107108        void EqvClass::print( std::ostream &os, Indenter indent ) const {
    108                 os << "( ";
    109                 std::copy( vars.begin(), vars.end(), std::ostream_iterator< std::string >( os, " " ) );
    110                 os << ")";
     109                if( !deterministic_output ) {
     110                        os << "( ";
     111                        std::copy( vars.begin(), vars.end(), std::ostream_iterator< std::string >( os, " " ) );
     112                        os << ")";
     113                }
    111114                if ( type ) {
    112115                        os << " -> ";
     
    235238                // check safely bindable
    236239                if ( r.type && occursIn( r.type, s.vars.begin(), s.vars.end(), *this ) ) return false;
    237                
     240
    238241                // merge classes in
    239242                r.vars.insert( s.vars.begin(), s.vars.end() );
  • src/main.cc

    re3bc51c rbcd74f3  
    449449
    450450
    451 static const char optstring[] = ":c:ghlLmNnpP:S:twW:D:";
     451static const char optstring[] = ":c:ghlLmNnpdP:S:twW:D:";
    452452
    453453enum { PreludeDir = 128 };
     
    462462        { "no-prelude", no_argument, nullptr, 'n' },
    463463        { "prototypes", no_argument, nullptr, 'p' },
     464        { "deterministic-out", no_argument, nullptr, 'd' },
    464465        { "print", required_argument, nullptr, 'P' },
    465466        { "prelude-dir", required_argument, nullptr, PreludeDir },
     
    482483        "do not read prelude",                                // -n
    483484        "generate prototypes for prelude functions",            // -p
     485        "don't print output that isn't deterministic",        // -d
    484486        "print",                                              // -P
    485487        "<directory> prelude directory for debug/nodebug",      // no flag
     
    586588                        genproto = true;
    587589                        break;
     590                  case 'd':                                     // don't print non-deterministic output
     591                    deterministic_output = true;
     592                        break;
    588593                  case 'P':                                                                             // print options
    589594                        for ( int i = 0;; i += 1 ) {
Note: See TracChangeset for help on using the changeset viewer.