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
44915666
Commit
44915666
authored
Mar 29, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consolidating a couple of files.
parent
a1173a63
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
92 deletions
+31
-92
Makefile
Makefile
+1
-1
document.cpp
document.cpp
+30
-0
document_emitter.cpp
document_emitter.cpp
+0
-27
document_eval_pending.cpp
document_eval_pending.cpp
+0
-64
No files found.
Makefile
View file @
44915666
build
:
sassc.cpp document.cpp node.cpp token.cpp prelexer.cpp
g++
-o
bin/sassc sassc.cpp document.cpp document_parser.cpp
document_eval_pending.cpp eval_apply.cpp document_emitter
.cpp node.cpp token.cpp prelexer.cpp
g++
-o
bin/sassc sassc.cpp document.cpp document_parser.cpp
eval_apply
.cpp node.cpp token.cpp prelexer.cpp
test
:
build
ruby spec.rb spec/basic/
...
...
document.cpp
View file @
44915666
#include <cstdio>
#include "document.hpp"
#include "eval_apply.hpp"
#include <iostream>
namespace
Sass
{
...
...
@@ -58,4 +59,32 @@ namespace Sass {
if
(
context
.
ref_count
==
0
)
delete
&
context
;
}
void
Document
::
eval_pending
()
{
for
(
int
i
=
0
;
i
<
context
.
pending
.
size
();
++
i
)
{
eval
(
context
.
pending
[
i
],
context
.
global_env
);
}
}
using
std
::
string
;
using
std
::
stringstream
;
using
std
::
endl
;
string
Document
::
emit_css
(
CSS_Style
style
)
{
stringstream
output
;
switch
(
style
)
{
case
echo
:
root
.
echo
(
output
);
break
;
case
nested
:
root
.
emit_nested_css
(
output
,
0
,
vector
<
string
>
());
break
;
case
expanded
:
root
.
emit_expanded_css
(
output
,
""
);
break
;
}
string
retval
(
output
.
str
());
if
(
!
retval
.
empty
())
retval
.
resize
(
retval
.
size
()
-
1
);
return
retval
;
}
}
\ No newline at end of file
document_emitter.cpp
deleted
100644 → 0
View file @
a1173a63
#include "document.hpp"
namespace
Sass
{
using
std
::
string
;
using
std
::
stringstream
;
using
std
::
endl
;
string
Document
::
emit_css
(
CSS_Style
style
)
{
stringstream
output
;
switch
(
style
)
{
case
echo
:
root
.
echo
(
output
);
break
;
case
nested
:
root
.
emit_nested_css
(
output
,
0
,
vector
<
string
>
());
break
;
case
expanded
:
root
.
emit_expanded_css
(
output
,
""
);
break
;
}
string
retval
(
output
.
str
());
if
(
!
retval
.
empty
())
retval
.
resize
(
retval
.
size
()
-
1
);
return
retval
;
}
}
\ No newline at end of file
document_eval_pending.cpp
deleted
100644 → 0
View file @
a1173a63
#include "document.hpp"
#include "eval_apply.hpp"
namespace
Sass
{
void
Document
::
eval_pending
()
{
for
(
int
i
=
0
;
i
<
context
.
pending
.
size
();
++
i
)
{
eval
(
context
.
pending
[
i
],
context
.
global_env
);
// Node n(context.pending[i]);
// switch (n.type)
// {
// // case Node::assignment: {
// // // Node val(n[1]);
// // // if (val.type == Node::comma_list || val.type == Node::space_list) {
// // // for (int i = 0; i < val.size(); ++i) {
// // // if (val[i].eval_me) val[i] = eval(val[i], context.global_env);
// // // }
// // // }
// // // else {
// // // val = eval(val, context.global_env);
// // // }
// // // context.global_env[n[0].token] = val;
// //
// // eval(n, context.global_env);
// // } break;
// //
// // case Node::rule: {
// // // treat top-level lists differently from nested ones
// // // Node rhs(n[1]);
// // // if (rhs.type == Node::comma_list || rhs.type == Node::space_list) {
// // // for (int i = 0; i < rhs.size(); ++i) {
// // // if (rhs[i].eval_me) rhs[i] = eval(rhs[i], context.global_env);
// // // }
// // // }
// // // else {
// // // n[1] = eval(n[1], context.global_env);
// // // }
// //
// // eval(n, context.global_env);
// // } break;
// //
// // case Node::mixin: {
// // // context.global_env[n[0].token] = n;
// //
// // eval(n, context.global_env);
// // } break;
//
// // case Node::expansion: {
// // Token name(n[0].token);
// // Node args(n[1]);
// // Node mixin(context.global_env[name]);
// // n.children->pop_back();
// // n.children->pop_back();
// // n += apply(mixin, args, context.global_env);
// // } break;
//
// default: eval(n, context.global_env);
// }
}
}
}
\ 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