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
ca0690c7
Commit
ca0690c7
authored
Mar 29, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Giving a field a better name.
parent
c8478d3b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
10 deletions
+13
-10
context.hpp
context.hpp
+12
-9
eval_apply.cpp
eval_apply.cpp
+1
-1
No files found.
context.hpp
View file @
ca0690c7
...
...
@@ -4,12 +4,15 @@ namespace Sass {
using
std
::
map
;
struct
Environment
{
map
<
Token
,
Node
>
frame
;
map
<
Token
,
Node
>
current_
frame
;
Environment
*
parent
;
Environment
()
:
frame
(
map
<
Token
,
Node
>
()),
parent
(
0
)
Environment
()
:
current_frame
(
map
<
Token
,
Node
>
()),
parent
(
0
)
{
}
Environment
(
Environment
*
env
)
:
frame
(
map
<
Token
,
Node
>
()),
parent
(
env
)
Environment
(
Environment
*
env
)
:
current_frame
(
map
<
Token
,
Node
>
()),
parent
(
env
)
{
}
void
link
(
Environment
&
env
)
...
...
@@ -17,16 +20,16 @@ namespace Sass {
bool
query
(
const
Token
&
key
)
const
{
if
(
frame
.
count
(
key
))
return
true
;
else
if
(
parent
)
return
parent
->
query
(
key
);
else
return
false
;
if
(
current_
frame
.
count
(
key
))
return
true
;
else
if
(
parent
)
return
parent
->
query
(
key
);
else
return
false
;
}
Node
&
operator
[](
const
Token
&
key
)
{
if
(
frame
.
count
(
key
))
return
frame
[
key
];
else
if
(
parent
)
return
(
*
parent
)[
key
];
else
return
frame
[
key
];
if
(
current_frame
.
count
(
key
))
return
current_
frame
[
key
];
else
if
(
parent
)
return
(
*
parent
)[
key
];
else
return
current_
frame
[
key
];
}
};
...
...
eval_apply.cpp
View file @
ca0690c7
...
...
@@ -46,7 +46,7 @@ namespace Sass {
env
[
expr
[
0
].
token
]
=
val
;
}
else
{
env
.
frame
[
expr
[
0
].
token
]
=
val
;
env
.
current_
frame
[
expr
[
0
].
token
]
=
val
;
}
return
expr
;
}
break
;
...
...
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