Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
楚学文
node-sass
Commits
bbd5032f
Commit
bbd5032f
authored
Feb 28, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding a unit test and fixing some bugs.
parent
cefe1e26
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
3 deletions
+35
-3
chars.txt
src/chars.txt
+14
-0
document.cpp
src/document.cpp
+5
-2
document.hpp
src/document.hpp
+2
-1
unit-test-document.cpp
src/unit-test-document.cpp
+14
-0
No files found.
src/chars.txt
0 → 100644
View file @
bbd5032f
#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
src/document.cpp
View file @
bbd5032f
...
...
@@ -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
src/document.hpp
View file @
bbd5032f
#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
src/unit-test-document.cpp
0 → 100644
View file @
bbd5032f
#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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment