diff options
author | Adrian Thurston <thurston@complang.org> | 2015-11-21 22:25:46 -0500 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2015-11-21 22:25:46 -0500 |
commit | 68be429ede12bfa28b96c713ff27ff4e45f9336c (patch) | |
tree | e9ab11011c4c52259b885ed7aa215a895e23c975 | |
parent | 2649f69523a6d551447b1a4dcb51ba541508e348 (diff) | |
download | colm-68be429ede12bfa28b96c713ff27ff4e45f9336c.tar.gz |
added line directives reduction code generator
-rw-r--r-- | src/reduce.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/reduce.cc b/src/reduce.cc index cb47e94f..9ab6a9c1 100644 --- a/src/reduce.cc +++ b/src/reduce.cc @@ -259,7 +259,10 @@ void Compiler::writeCommit() for ( ReduceNonTermList::Iter rdi = (*r)->reduceNonTerms; rdi.lte(); rdi++ ) { *outStream << "struct lel_" << rdi->nonTerm->uniqueType->langEl->fullName << "\n" - "{"; + "{\n"; + + *outStream << + "#line " << rdi->loc.line << "\"" << rdi->loc.fileName << "\"\n"; writeHostItemList( 0, rdi->itemList ); @@ -391,6 +394,10 @@ void Compiler::writeCommit() " if ( kid->tree->prod_num == " << prodNum << " ) {\n"; loadRefs( action->production, action->itemList ); + + *outStream << + "#line " << action->loc.line << "\"" << action->loc.fileName << "\"\n"; + writeHostItemList( action->production, action->itemList ); *outStream << |