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
4aaa7c96
Commit
4aaa7c96
authored
Sep 19, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Still working on arithmetic.
parent
350f04a1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
3 deletions
+29
-3
eval_apply.cpp
eval_apply.cpp
+29
-3
No files found.
eval_apply.cpp
View file @
4aaa7c96
...
...
@@ -498,7 +498,7 @@ namespace Sass {
Node
op
(
list
[
head
+
1
]);
Node
::
Type
optype
=
op
.
type
();
if
(
acc
.
is_string
())
{
acc
=
new_Node
(
Node
::
concatenation
,
list
.
path
(),
list
.
line
(),
2
);
acc
=
(
new_Node
(
Node
::
concatenation
,
list
.
path
(),
list
.
line
(),
2
)
<<
acc
);
if
(
optype
==
Node
::
sub
||
optype
==
Node
::
div
||
optype
==
Node
::
mul
)
{
acc
<<
op
;
}
...
...
@@ -525,9 +525,35 @@ namespace Sass {
}
}
else
if
(
ltype
==
Node
::
number
&&
rtype
==
Node
::
numeric_color
)
{
if
(
optype
!=
Node
::
sub
&&
optype
!=
Node
::
div
)
{
double
r
=
operate
(
optype
,
acc
.
numeric_value
(),
rhs
[
0
].
numeric_value
());
double
g
=
operate
(
optype
,
acc
.
numeric_value
(),
rhs
[
1
].
numeric_value
());
double
b
=
operate
(
optype
,
acc
.
numeric_value
(),
rhs
[
2
].
numeric_value
());
double
a
=
rhs
[
3
].
numeric_value
();
acc
=
new_Node
(
list
.
path
(),
list
.
line
(),
r
,
g
,
b
,
a
);
}
else
(
optype
==
Node
::
div
||
optype
)
{
acc
=
(
new_Node
(
Node
::
concatenation
,
list
.
path
(),
list
.
line
(),
3
)
<<
acc
);
acc
<<
op
;
acc
<<
rhs
;
}
}
else
if
(
ltype
==
Node
::
numeric_color
&&
rtype
==
Node
::
number
)
{
double
r
=
operate
(
optype
,
acc
[
0
].
numeric_value
(),
rhs
.
numeric_value
());
double
g
=
operate
(
optype
,
acc
[
1
].
numeric_value
(),
rhs
.
numeric_value
());
double
b
=
operate
(
optype
,
acc
[
2
].
numeric_value
(),
rhs
.
numeric_value
());
double
a
=
acc
[
3
].
numeric_value
();
acc
=
new_Node
(
list
.
path
(),
list
.
line
(),
r
,
g
,
b
,
a
);
}
else
if
(
ltype
==
Node
::
numeric_color
&&
rtype
==
Node
::
numeric_color
)
{
if
(
acc
[
3
].
numeric_value
()
!=
rhs
[
3
].
numeric_value
())
throw_eval_error
(
"alpha channels must be equal for "
+
acc
.
to_string
()
+
" + "
+
rhs
.
to_string
(),
acc
.
path
(),
acc
.
line
());
double
r
=
operate
(
optype
,
acc
[
0
].
numeric_value
(),
rhs
[
0
].
numeric_value
());
double
g
=
operate
(
optype
,
acc
[
1
].
numeric_value
(),
rhs
[
1
].
numeric_value
());
double
b
=
operate
(
optype
,
acc
[
2
].
numeric_value
(),
rhs
[
2
].
numeric_value
());
double
a
=
acc
[
3
].
numeric_value
();
acc
=
new_Node
(
list
.
path
(),
list
.
line
(),
r
,
g
,
b
,
a
);
}
// NOT DONE YET!
return
reduce
(
list
,
head
+
3
,
acc
,
new_Node
);
}
...
...
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