Skip to content

Commit

Permalink
Debug logging for @import
Browse files Browse the repository at this point in the history
  • Loading branch information
saper committed May 2, 2015
1 parent 66631c0 commit ce80c54
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "emitter.hpp"

#include <string>
#include <stdio.h>
#include <cstdlib>
#include <cstring>
#include <iomanip>
Expand Down Expand Up @@ -319,11 +320,13 @@ namespace Sass {
0, 0
);
import_stack.push_back(import);
fprintf(stderr, "Running queue[%zu]: [%s] via parser\n", i, queue[i].source);
Parser p(Parser::from_c_str(queue[i].source, *this, ParserState(queue[i].abs_path, queue[i].source, i)));
Block* ast = p.parse();
sass_delete_import(import_stack.back());
import_stack.pop_back();
if (i == 0) root = ast;
fprintf(stderr, "Adding to style_sheets: %s\n", queue[i].load_path.c_str());
style_sheets[queue[i].load_path] = ast;
}
if (root == 0) return 0;
Expand Down
2 changes: 2 additions & 0 deletions expand.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "backtrace.hpp"
#include "context.hpp"
#include "parser.hpp"
#include <stdio.h>

namespace Sass {

Expand Down Expand Up @@ -283,6 +284,7 @@ namespace Sass {

Statement* Expand::operator()(Import_Stub* i)
{
fprintf(stderr, "Expand::operator(): Appending: %s\n", i->file_name().c_str());
append_block(ctx.style_sheets[i->file_name()]);
return 0;
}
Expand Down
2 changes: 2 additions & 0 deletions parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "sass_functions.h"

#include <typeinfo>
#include <stdio.h>

namespace Sass {
using namespace std;
Expand Down Expand Up @@ -80,6 +81,7 @@ namespace Sass {
lex< optional_spaces >();
Selector_Lookahead lookahead_result;
while (position < end) {
fprintf(stderr, "Parsing at %p: %s\n", position, position);
parse_block_comments(root);
if (peek< kwd_import >()) {
Import* imp = parse_import();
Expand Down

0 comments on commit ce80c54

Please sign in to comment.