diff --git a/INSTALL b/INSTALL index d0a4d6b998673b25fd46d522884f920e2d878a98..2f63349502dfb6eaa64a6bcc1c537855e1ed495c 100644 --- a/INSTALL +++ b/INSTALL @@ -47,6 +47,7 @@ Compile lmfit: $ cd lmfit $ gcc -c lmmin.c +$ ar cr liblmmin.a lmmin.o // TODO: only needed because of qmake madness $ cd .. Compile and install libyaml: diff --git a/src/file_io.cpp b/src/file_io.cpp index 03c2ddf7438f664e0c2ccbd5624af48751d2a9a2..1ed0efe6c212dbe4c4be27dbc8e85de92950cd50 100644 --- a/src/file_io.cpp +++ b/src/file_io.cpp @@ -80,14 +80,8 @@ void NFileIO::Load_08( FILE *F_in, string flong ) mystd::fname_divide( flong, &fdir, &fshort, &fext); - if( yin_parse_file( F_in, yin ) ){ - printf( "yin_parse_file failed\n" ); - return; - } - if( yin==0 ){ - printf( "yin=0\n" ); - return; - } + yin_parse_file( F_in, yin ); + if( yin==0 ) throw "yin=0\n"; yin->show( 0 ); diff --git a/test/bm-cf5.ml b/src/test/bm-cf5.ml similarity index 100% rename from test/bm-cf5.ml rename to src/test/bm-cf5.ml diff --git a/test/bm-cf6.ml b/src/test/bm-cf6.ml similarity index 100% rename from test/bm-cf6.ml rename to src/test/bm-cf6.ml diff --git a/test/d1.a01 b/src/test/d1.a01 similarity index 100% rename from test/d1.a01 rename to src/test/d1.a01 diff --git a/test/d2.a01 b/src/test/d2.a01 similarity index 100% rename from test/d2.a01 rename to src/test/d2.a01 diff --git a/test/d2.i96 b/src/test/d2.i96 similarity index 100% rename from test/d2.i96 rename to src/test/d2.i96 diff --git a/test/d2.y08 b/src/test/d2.y08 similarity index 100% rename from test/d2.y08 rename to src/test/d2.y08 diff --git a/test/d3.a01 b/src/test/d3.a01 similarity index 100% rename from test/d3.a01 rename to src/test/d3.a01 diff --git a/test/d3.y08 b/src/test/d3.y08 similarity index 100% rename from test/d3.y08 rename to src/test/d3.y08 diff --git a/src/yamc.cpp b/src/yamc.cpp index 4868d358fe60eb0eb223c3d7f0ef52d3babe6a66..5c4a536436403dbba28ce525fc173dd46d78f33c 100644 --- a/src/yamc.cpp +++ b/src/yamc.cpp @@ -18,6 +18,8 @@ void CYam::show( int indent ) const break; case _A: cout << "ARR"; + for( i=0; i<<a.size(); ++i ) + a[i]->show( indent + 2 ); break; case _M: cout << "MAP"; @@ -67,16 +69,13 @@ int yinlex( yaml_event_t* yinlval ) { */ } -int yin_parse_file( FILE *F_in, CYam *yin ) +void yin_parse_file( FILE *F_in, CYam *yin ) { - int ret; memset(&parser, 0, sizeof(parser)); memset(&input_event, 0, sizeof(input_event)); - if (!yaml_parser_initialize(&parser)) { - fprintf(stderr, "Could not initialize the parser object\n"); - return -1; - } + if (!yaml_parser_initialize(&parser)) + throw "Could not initialize the parser object\n"; yaml_parser_set_input_file( &parser, F_in ); @@ -84,6 +83,4 @@ int yin_parse_file( FILE *F_in, CYam *yin ) yaml_event_delete(&input_event); yaml_parser_delete(&parser); - - return ret; } diff --git a/src/yamc.h b/src/yamc.h index 94be600e2e4c7f85d2a7d15c0f3f047559faab80..88a148c4070369c9bf2817a7dfd9828201d2ce3d 100644 --- a/src/yamc.h +++ b/src/yamc.h @@ -22,4 +22,4 @@ class CYam { void show( int indent) const; }; -int yin_parse_file( FILE *F_in, CYam *yin ); +void yin_parse_file( FILE *F_in, CYam *yin );