Goose  Diff

Differences From Artifact [0d219a26bf]:

  • File bs/empathy.cpp — part of check-in [47708770e6] at 2019-04-13 22:03:00 on branch trunk — api: added a builtin Execute command, which executes the specified file. Also added the possibility to optionally return an error code. (user: achavasse size: 508)

To Artifact [e44b313b0a]:

  • File bs/empathy.cpp — part of check-in [bd2fd03a33] at 2019-08-10 17:50:32 on branch trunk — lexer: generate token locations. (user: achavasse size: 480)

1
2
3
4
5
6
7
8
9

10
11

12
13
14

15
16
17
18
19
20
21
1
2
3
4
5
6
7
8

9
10

11
12
13

14
15
16
17
18
19
20
21








-
+

-
+


-
+







#include "compiler.h"

using namespace std;
using namespace empathy;
using namespace empathy::util;

int main( int argc, char** argv )
{
    auto filename = make_shared< string >( "em/lib/empathy.em" );
    const char* filename = "em/lib/empathy.em";

    ifstream sourcefile( filename->c_str() );
    ifstream sourcefile( filename );
    if( !sourcefile.good() )
    {
        cout << "can't open '" << *filename << "'\n";
        cout << "can't open '" << filename << "'\n";
        return EXIT_FAILURE;
    }

    Compiler ec( argc, argv );
    if( ec.execute( sourcefile, filename ) )
        return EXIT_SUCCESS;