aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/build.y7
-rw-r--r--src/builder.cpp10
-rw-r--r--src/builder.h2
3 files changed, 12 insertions, 7 deletions
diff --git a/src/build.y b/src/build.y
index 4d87a86..bf565fb 100644
--- a/src/build.y
+++ b/src/build.y
@@ -244,10 +244,5 @@ rulecompletion: TOK_COMMAND STRING
244 244
245void yyerror( YYLTYPE *locp, Builder &bld, char const *msg ) 245void yyerror( YYLTYPE *locp, Builder &bld, char const *msg )
246{ 246{
247 fprintf( stderr, "%s:%d-%d:%d-%d: %s\n", 247 bld.error( locp, msg );
248 bld.file.c_str(),
249 locp->first_line, locp->last_line,
250 locp->first_column, locp->last_column,
251 msg
252 );
253} 248}
diff --git a/src/builder.cpp b/src/builder.cpp
index 3bcd593..d3cb2c0 100644
--- a/src/builder.cpp
+++ b/src/builder.cpp
@@ -563,3 +563,13 @@ void Builder::error( const std::string &err )
563 throw BuildException( err.c_str() ); 563 throw BuildException( err.c_str() );
564} 564}
565 565
566void Builder::error( YYLTYPE *locp, const std::string &err )
567{
568 fprintf( stderr, "%s:%d-%d:%d-%d: %s\n",
569 file.c_str(),
570 locp->first_line, locp->last_line,
571 locp->first_column, locp->last_column,
572 err.c_str()
573 );
574}
575
diff --git a/src/builder.h b/src/builder.h
index 152b969..06e84f3 100644
--- a/src/builder.h
+++ b/src/builder.h
@@ -39,7 +39,7 @@ public:
39 void build( const char *sAct=NULL ); 39 void build( const char *sAct=NULL );
40 void execute( Action *pAct ); 40 void execute( Action *pAct );
41 41
42 //void error( const yy::location &l, const std::string &m ); 42 void error( YYLTYPE *locp, const std::string &m );
43 void error( const std::string &m ); 43 void error( const std::string &m );
44 44
45 std::string file; 45 std::string file;