summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2015-11-21 22:25:46 -0500
committerAdrian Thurston <thurston@complang.org>2015-11-21 22:25:46 -0500
commit68be429ede12bfa28b96c713ff27ff4e45f9336c (patch)
treee9ab11011c4c52259b885ed7aa215a895e23c975
parent2649f69523a6d551447b1a4dcb51ba541508e348 (diff)
downloadcolm-68be429ede12bfa28b96c713ff27ff4e45f9336c.tar.gz
added line directives reduction code generator
-rw-r--r--src/reduce.cc9
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 <<