Commit bbd5032f by Aaron Leung

Adding a unit test and fixing some bugs.

parent cefe1e26
#header > #leftpane > [data-ur-tabs-component="button"] {
> div {
padding: 10px;
}
> div:after {
content: "▼";
float: right;
}
&[data-ur-state="enabled"] > div:after {
content: "▲";
float: right;
}
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
namespace Sass {
Document::Document(char* _path, char* _source) {
path = _path;
if (!source) {
if (!_source) {
std::FILE *f;
f = std::fopen(path, "rb");
// if (!f) {
......@@ -14,7 +14,6 @@ namespace Sass {
std::fseek(f, 0, SEEK_END);
int len = std::ftell(f);
std::rewind(f);
// char *buf = (char *)malloc(len * sizeof(char) + 1);
source = new char[len + 1];
std::fread(source, sizeof(char), len, f);
source[len] = '\0';
......@@ -24,4 +23,7 @@ namespace Sass {
source = _source;
}
}
Document::~Document() {
delete [] source;
}
}
\ No newline at end of file
#include <vector>
#include "node.hpp"
namespace Sass {
......@@ -12,5 +11,6 @@ namespace Sass {
vector<Node> statements;
Document(char* _path, char* _source = 0);
~Document();
};
}
\ No newline at end of file
#include <cstdio>
#include "document.hpp"
using namespace Sass;
int main(int argc, char* argv[]) {
Document doc(argv[1], 0);
char* src = doc.source;
printf("FILE BEGINS ON NEXT LINE\n");
while (*src) std::putchar(*(src++));
printf("<EOF>\n");
return 0;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment