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
6eb7c4ed
Commit
6eb7c4ed
authored
Sep 20, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Overhauled the implementation of arithmetic. Much less janky now.
parent
4aaa7c96
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
5 deletions
+15
-5
eval_apply.cpp
eval_apply.cpp
+0
-0
eval_apply.hpp
eval_apply.hpp
+2
-1
node.hpp
node.hpp
+2
-2
node_emitters.cpp
node_emitters.cpp
+11
-2
No files found.
eval_apply.cpp
View file @
6eb7c4ed
This diff is collapsed.
Click to expand it.
eval_apply.hpp
View file @
6eb7c4ed
...
...
@@ -15,8 +15,9 @@ namespace Sass {
Node
eval
(
Node
expr
,
Node
prefix
,
Environment
&
env
,
map
<
string
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
ctx
,
bool
function_name
=
false
);
Node
function_eval
(
string
name
,
Node
stm
,
Environment
&
bindings
,
Node_Factory
&
new_Node
,
Context
&
ctx
,
bool
toplevel
=
false
);
Node
reduce
(
Node
list
,
size_t
head
,
Node
acc
,
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
op
,
double
lhs
,
double
rhs
);
Node
apply_mixin
(
Node
mixin
,
const
Node
args
,
Node
prefix
,
Environment
&
env
,
map
<
string
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
ctx
,
bool
dynamic_scope
=
false
);
Node
apply_function
(
const
Function
&
f
,
const
Node
args
,
Node
prefix
,
Environment
&
env
,
map
<
string
,
Function
>&
f_env
,
Node_Factory
&
new_Node
,
Context
&
ctx
,
string
&
path
,
size_t
line
);
...
...
node.hpp
View file @
6eb7c4ed
...
...
@@ -182,7 +182,7 @@ namespace Sass {
Type
type
()
const
;
bool
is_
stub
()
const
;
bool
is_
none
()
const
;
bool
has_children
()
const
;
bool
has_statements
()
const
;
bool
has_blocks
()
const
;
...
...
@@ -416,7 +416,7 @@ namespace Sass {
inline
Node
::
Type
Node
::
type
()
const
{
return
ip_
->
type
;
}
inline
bool
Node
::
is_
stub
()
const
{
return
!
ip_
;
}
inline
bool
Node
::
is_
none
()
const
{
return
!
ip_
;
}
inline
bool
Node
::
has_children
()
const
{
return
ip_
->
has_children
;
}
inline
bool
Node
::
has_statements
()
const
{
return
ip_
->
has_statements
;
}
inline
bool
Node
::
has_blocks
()
const
{
return
ip_
->
has_blocks
;
}
...
...
node_emitters.cpp
View file @
6eb7c4ed
...
...
@@ -140,6 +140,7 @@ namespace Sass {
return
result
;
}
break
;
// still necessary for unevaluated expressions
case
expression
:
case
term
:
{
string
result
(
at
(
0
).
to_string
());
...
...
@@ -348,12 +349,20 @@ namespace Sass {
case
concatenation
:
{
string
result
;
bool
quoted
=
(
at
(
0
).
type
()
==
string_constant
||
at
(
0
).
type
()
==
string_schema
)
?
true
:
false
;
for
(
size_t
i
=
0
,
S
=
size
();
i
<
S
;
++
i
)
{
result
+=
at
(
i
).
to_string
().
substr
(
1
,
at
(
i
).
token
().
length
()
-
2
);
// result += at(i).to_string().substr(1, at(i).token().length()-2);
Node
::
Type
itype
=
at
(
i
).
type
();
if
(
itype
==
Node
::
string_constant
||
itype
==
Node
::
string_schema
)
{
result
+=
at
(
i
).
unquote
();
}
else
{
result
+=
at
(
i
).
to_string
();
}
}
// if (inside_of == identifier_schema || inside_of == property) return result;
// else return "\"" + result + "\"";
if
(
!
(
inside_of
==
identifier_schema
||
inside_of
==
property
)
&&
!
is_unquoted
())
{
if
(
!
(
inside_of
==
identifier_schema
||
inside_of
==
property
)
&&
quoted
&&
!
is_unquoted
())
{
result
=
"
\"
"
+
result
+
"
\"
"
;
}
return
result
;
...
...
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