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
66f27795
Commit
66f27795
authored
Apr 20, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allowing calls to non-Sass functions to pass through. Apparently this is allowed.
parent
aba60c5c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
5 deletions
+27
-5
document_parser.cpp
src/document_parser.cpp
+2
-2
eval_apply.cpp
src/eval_apply.cpp
+4
-3
node.cpp
src/node.cpp
+21
-0
No files found.
src/document_parser.cpp
View file @
66f27795
...
...
@@ -655,13 +655,13 @@ namespace Sass {
if
(
!
lex
<
exactly
<
')'
>
>
())
syntax_error
(
"unclosed parenthesis"
);
return
value
;
}
else
if
(
lex
<
exactly
<
'+'
>
>
())
{
else
if
(
lex
<
sequence
<
exactly
<
'+'
>
,
negate
<
number
>
>
>
())
{
Node
plus
(
Node
::
unary_plus
,
context
.
registry
,
line_number
,
1
);
plus
<<
parse_factor
();
plus
.
eval_me
=
true
;
return
plus
;
}
else
if
(
lex
<
exactly
<
'-'
>
>
())
{
else
if
(
lex
<
sequence
<
exactly
<
'-'
>
,
negate
<
number
>
>
>
())
{
Node
minus
(
Node
::
unary_minus
,
context
.
registry
,
line_number
,
1
);
minus
<<
parse_factor
();
minus
.
eval_me
=
true
;
...
...
src/eval_apply.cpp
View file @
66f27795
...
...
@@ -216,9 +216,10 @@ namespace Sass {
// TO DO: default-constructed Function should be a generic callback
pair
<
string
,
size_t
>
sig
(
expr
[
0
].
content
.
token
.
to_string
(),
expr
[
1
].
size
());
if
(
!
f_env
.
count
(
sig
))
{
stringstream
ss
;
ss
<<
"no function named "
<<
expr
[
0
].
content
.
token
.
to_string
()
<<
" taking "
<<
expr
[
1
].
size
()
<<
" arguments has been defined"
;
eval_error
(
ss
.
str
(),
expr
.
line_number
,
expr
.
file_name
);
// stringstream ss;
// ss << "no function named " << expr[0].content.token.to_string() << " taking " << expr[1].size() << " arguments has been defined";
// eval_error(ss.str(), expr.line_number, expr.file_name);
return
expr
;
}
return
apply_function
(
f_env
[
sig
],
expr
[
1
],
env
,
f_env
,
registry
);
}
break
;
...
...
src/node.cpp
View file @
66f27795
...
...
@@ -174,6 +174,27 @@ namespace Sass {
return
"/"
;
}
break
;
case
function_call
:
{
stringstream
ss
;
ss
<<
at
(
0
).
to_string
(
""
);
ss
<<
"("
;
ss
<<
at
(
1
).
to_string
(
""
);
ss
<<
")"
;
return
ss
.
str
();
}
case
arguments
:
{
stringstream
ss
;
if
(
size
()
>
0
)
{
ss
<<
at
(
0
).
to_string
(
""
);
for
(
int
i
=
1
;
i
<
size
();
++
i
)
{
ss
<<
", "
;
ss
<<
at
(
i
).
to_string
(
""
);
}
}
return
ss
.
str
();
}
case
unary_plus
:
{
stringstream
ss
;
ss
<<
"+"
;
...
...
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