first-stage/PARSE: Remove two-part error messages · BLLIP/bllip-parser@33343f3 · GitHub
Skip to content

Commit 33343f3

Browse files
committed
first-stage/PARSE: Remove two-part error messages
These are messages where parts are printed to stderr followed by an assertion failure. Now there is only an assertion failure (which converts more cleanly into Python exceptions).
1 parent c6c61fa commit 33343f3

4 files changed

Lines changed: 25 additions & 18 deletions

File tree

‎first-stage/PARSE/InputTree.C‎

Lines changed: 10 additions & 11 deletions

‎first-stage/PARSE/utils.C‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ error(const char *s)
5252
ERROR( s );
5353
}
5454

55+
void
56+
error(const char *filename, int filelinenum, string str)
57+
{
58+
const char* s = str.c_str();
59+
error(filename, filelinenum, s);
60+
}
61+
5562
ECString
5663
langAwareToLower(ECString str)
5764
{

‎first-stage/PARSE/utils.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@
2424
#define WARN( msg ) if (!Bchart::silent) { warn( __FILE__, __LINE__, msg ); }
2525
#define ERROR( msg ) error( __FILE__, __LINE__, msg )
2626

27-
void warn( const char *filename, int filelinenum, const char *msg );
28-
void error( const char *filename, int filelinenum, const char *msg );
27+
void warn(const char *filename, int filelinenum, const char *msg);
28+
void error(const char *filename, int filelinenum, const char *msg);
29+
void error(const char *filename, int filelinenum, string str);
2930
void error(const char *s); // backwards compatibility
3031

3132
ECString langAwareToLower(ECString str);

‎python/tests/test_tree.py‎

Lines changed: 5 additions & 5 deletions

0 commit comments

Comments
 (0)