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
f377899e
Commit
f377899e
authored
Jun 08, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Working on string concatenation. Still need to tweak the emitter.
parent
2b945a09
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
0 deletions
+51
-0
eval_apply.cpp
eval_apply.cpp
+43
-0
node_emitters.cpp
node_emitters.cpp
+8
-0
No files found.
eval_apply.cpp
View file @
f377899e
...
@@ -496,6 +496,49 @@ namespace Sass {
...
@@ -496,6 +496,49 @@ namespace Sass {
acc
.
pop_back
();
acc
.
pop_back
();
acc
<<
new_Node
(
acc
.
path
(),
acc
.
line
(),
r
,
g
,
b
,
a
);
acc
<<
new_Node
(
acc
.
path
(),
acc
.
line
(),
r
,
g
,
b
,
a
);
}
}
else
if
(
lhs
.
type
()
==
Node
::
concatenation
&&
rhs
.
type
()
==
Node
::
concatenation
)
{
if
(
op
==
Node
::
add
)
{
lhs
+=
rhs
;
}
else
{
acc
<<
new_Node
(
op
,
acc
.
path
(),
acc
.
line
(),
Token
::
make
());
acc
<<
rhs
;
}
}
else
if
(
lhs
.
type
()
==
Node
::
concatenation
&&
rhs
.
type
()
==
Node
::
string_constant
)
{
if
(
op
==
Node
::
add
)
{
lhs
<<
rhs
;
}
else
{
acc
<<
new_Node
(
op
,
acc
.
path
(),
acc
.
line
(),
Token
::
make
());
acc
<<
rhs
;
}
}
else
if
(
lhs
.
type
()
==
Node
::
string_constant
&&
rhs
.
type
()
==
Node
::
concatenation
)
{
if
(
op
==
Node
::
add
)
{
Node
new_cat
(
new_Node
(
Node
::
concatenation
,
lhs
.
path
(),
lhs
.
line
(),
1
+
rhs
.
size
()));
new_cat
<<
lhs
;
new_cat
+=
rhs
;
acc
.
pop_back
();
acc
<<
new_cat
;
}
else
{
acc
<<
new_Node
(
op
,
acc
.
path
(),
acc
.
line
(),
Token
::
make
());
acc
<<
rhs
;
}
}
else
if
(
lhs
.
type
()
==
Node
::
string_constant
&&
rhs
.
type
()
==
Node
::
string_constant
)
{
if
(
op
==
Node
::
add
)
{
Node
new_cat
(
new_Node
(
Node
::
concatenation
,
lhs
.
path
(),
lhs
.
line
(),
2
));
new_cat
<<
lhs
<<
rhs
;
acc
.
pop_back
();
acc
<<
new_cat
;
}
else
{
acc
<<
new_Node
(
op
,
acc
.
path
(),
acc
.
line
(),
Token
::
make
());
acc
<<
rhs
;
}
}
else
{
else
{
// TO DO: disallow division and multiplication on lists
// TO DO: disallow division and multiplication on lists
if
(
op
==
Node
::
sub
)
acc
<<
new_Node
(
Node
::
sub
,
acc
.
path
(),
acc
.
line
(),
Token
::
make
());
if
(
op
==
Node
::
sub
)
acc
<<
new_Node
(
Node
::
sub
,
acc
.
path
(),
acc
.
line
(),
Token
::
make
());
...
...
node_emitters.cpp
View file @
f377899e
...
@@ -324,6 +324,14 @@ namespace Sass {
...
@@ -324,6 +324,14 @@ namespace Sass {
return
result
;
return
result
;
}
break
;
}
break
;
case
concatenation
:
{
string
result
;
for
(
size_t
i
=
0
,
S
=
size
();
i
<
S
;
++
i
)
{
result
+=
at
(
i
).
token
().
unquote
();
}
return
"
\"
"
+
result
+
"
\"
"
;
}
break
;
case
warning
:
{
case
warning
:
{
string
prefix
(
"WARNING: "
);
string
prefix
(
"WARNING: "
);
string
indent
(
" "
);
string
indent
(
" "
);
...
...
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