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
df9b4e6a
Commit
df9b4e6a
authored
May 27, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Selector interpolation works robustly (sans a few special cases).
parent
bf146431
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
22 deletions
+20
-22
document.cpp
document.cpp
+4
-3
document.hpp
document.hpp
+7
-2
document_parser.cpp
document_parser.cpp
+4
-0
eval_apply.cpp
eval_apply.cpp
+0
-0
eval_apply.hpp
eval_apply.hpp
+4
-3
sass_interface.cpp
sass_interface.cpp
+1
-14
No files found.
document.cpp
View file @
df9b4e6a
...
@@ -60,17 +60,18 @@ namespace Sass {
...
@@ -60,17 +60,18 @@ namespace Sass {
return
doc
;
return
doc
;
}
}
Document
Document
::
make_from_source_chars
(
Context
&
ctx
,
char
*
src
,
string
path
)
Document
Document
::
make_from_source_chars
(
Context
&
ctx
,
char
*
src
,
string
path
,
bool
own_source
)
{
{
Document
doc
(
ctx
);
Document
doc
(
ctx
);
doc
.
path
=
path
;
doc
.
path
=
path
;
doc
.
line
=
1
;
doc
.
line
=
1
;
doc
.
root
=
ctx
.
new_Node
(
Node
::
root
,
path
,
1
,
0
);
doc
.
root
=
ctx
.
new_Node
(
Node
::
root
,
path
,
1
,
0
);
doc
.
lexed
=
Token
::
make
();
doc
.
lexed
=
Token
::
make
();
doc
.
own_source
=
fals
e
;
doc
.
own_source
=
own_sourc
e
;
doc
.
source
=
src
;
doc
.
source
=
src
;
doc
.
end
=
src
+
std
::
strlen
(
src
);
doc
.
end
=
src
+
std
::
strlen
(
src
);
doc
.
position
=
doc
.
end
;
doc
.
position
=
src
;
if
(
own_source
)
doc
.
context
.
source_refs
.
push_back
(
src
);
return
doc
;
return
doc
;
}
}
...
...
document.hpp
View file @
df9b4e6a
#include <map>
#include <map>
#ifndef SASS_PRELEXER_INCLUDED
#include "prelexer.hpp"
#endif
#ifndef SASS_NODE_INCLUDED
#ifndef SASS_NODE_INCLUDED
#include "node.hpp"
#include "node.hpp"
#endif
#endif
#i
nclude "prelexer.hpp"
#i
fndef SASS_CONTEXT_INCLUDED
#include "context.hpp"
#include "context.hpp"
#endif
struct
Selector_Lookahead
{
struct
Selector_Lookahead
{
const
char
*
found
;
const
char
*
found
;
...
@@ -41,7 +46,7 @@ namespace Sass {
...
@@ -41,7 +46,7 @@ namespace Sass {
~
Document
();
~
Document
();
static
Document
make_from_file
(
Context
&
ctx
,
string
path
);
static
Document
make_from_file
(
Context
&
ctx
,
string
path
);
static
Document
make_from_source_chars
(
Context
&
ctx
,
char
*
src
,
string
path
=
""
);
static
Document
make_from_source_chars
(
Context
&
ctx
,
char
*
src
,
string
path
=
""
,
bool
own_source
=
false
);
static
Document
make_from_token
(
Context
&
ctx
,
Token
t
,
string
path
=
""
,
size_t
line_number
=
1
);
static
Document
make_from_token
(
Context
&
ctx
,
Token
t
,
string
path
=
""
,
size_t
line_number
=
1
);
template
<
prelexer
mx
>
template
<
prelexer
mx
>
...
...
document_parser.cpp
View file @
df9b4e6a
...
@@ -898,6 +898,10 @@ namespace Sass {
...
@@ -898,6 +898,10 @@ namespace Sass {
prefix_match
,
prefix_match
,
suffix_match
,
suffix_match
,
substring_match
>
>
(
p
))
||
substring_match
>
>
(
p
))
||
(
q
=
peek
<
sequence
<
exactly
<
'.'
>
,
interpolant
>
>
(
p
))
||
(
q
=
peek
<
sequence
<
exactly
<
'#'
>
,
interpolant
>
>
(
p
))
||
(
q
=
peek
<
sequence
<
exactly
<
'-'
>
,
interpolant
>
>
(
p
))
||
(
q
=
peek
<
sequence
<
pseudo_prefix
,
interpolant
>
>
(
p
))
||
(
q
=
peek
<
interpolant
>
(
p
)))
{
(
q
=
peek
<
interpolant
>
(
p
)))
{
p
=
q
;
p
=
q
;
if
(
*
(
p
-
1
)
==
'}'
)
saw_interpolant
=
true
;
if
(
*
(
p
-
1
)
==
'}'
)
saw_interpolant
=
true
;
...
...
eval_apply.cpp
View file @
df9b4e6a
This diff is collapsed.
Click to expand it.
eval_apply.hpp
View file @
df9b4e6a
...
@@ -11,10 +11,10 @@
...
@@ -11,10 +11,10 @@
namespace
Sass
{
namespace
Sass
{
using
std
::
map
;
using
std
::
map
;
Node
eval
(
Node
&
expr
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
);
Node
eval
(
Node
&
expr
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
src_refs
);
Node
accumulate
(
Node
::
Type
op
,
Node
&
acc
,
Node
&
rhs
,
Node_Factory
&
new_Node
);
Node
accumulate
(
Node
::
Type
op
,
Node
&
acc
,
Node
&
rhs
,
Node_Factory
&
new_Node
);
double
operate
(
Node
::
Type
op
,
double
lhs
,
double
rhs
);
double
operate
(
Node
::
Type
op
,
double
lhs
,
double
rhs
);
Node
apply_mixin
(
Node
&
mixin
,
const
Node
&
args
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
);
Node
apply_mixin
(
Node
&
mixin
,
const
Node
&
args
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
src_refs
);
Node
apply_function
(
const
Function
&
f
,
const
Node
&
args
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
);
Node
apply_function
(
const
Function
&
f
,
const
Node
&
args
,
Environment
&
env
,
map
<
pair
<
string
,
size_t
>
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
src_refs
);
}
}
\ No newline at end of file
sass_interface.cpp
View file @
df9b4e6a
...
@@ -39,21 +39,8 @@ extern "C" {
...
@@ -39,21 +39,8 @@ extern "C" {
{
{
using
namespace
Sass
;
using
namespace
Sass
;
doc
.
parse_scss
();
doc
.
parse_scss
();
// cerr << "PARSED" << endl;
eval
(
doc
.
root
,
doc
.
context
.
global_env
,
doc
.
context
.
function_env
,
doc
.
context
.
new_Node
,
doc
.
context
);
eval
(
doc
.
root
,
doc
.
context
.
global_env
,
doc
.
context
.
function_env
,
doc
.
context
.
new_Node
);
// cerr << "EVALUATED" << endl;
string
output
(
doc
.
emit_css
(
static_cast
<
Document
::
CSS_Style
>
(
style
)));
string
output
(
doc
.
emit_css
(
static_cast
<
Document
::
CSS_Style
>
(
style
)));
// cerr << "EMITTED" << endl;
// cerr << "Allocations:\t" << Node::allocations << endl;
// cerr << "Destructions:\t" << Node::destructed << endl;
// cerr << "Registry size:\t" << doc.context.registry.size() << endl;
// for (size_t i = 0; i < doc.context.registry.size(); ++i) {
// delete doc.context.registry[i];
// }
// cerr << "Deallocations:\t" << i << endl;
char
*
c_output
=
(
char
*
)
malloc
(
output
.
size
()
+
1
);
char
*
c_output
=
(
char
*
)
malloc
(
output
.
size
()
+
1
);
strcpy
(
c_output
,
output
.
c_str
());
strcpy
(
c_output
,
output
.
c_str
());
return
c_output
;
return
c_output
;
...
...
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