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
d74cdbb2
Commit
d74cdbb2
authored
Aug 31, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Getting ready to improve native function resolution and definition.
parent
ec641613
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
32 deletions
+39
-32
context.hpp
context.hpp
+8
-32
document.hpp
document.hpp
+2
-0
error.hpp
error.hpp
+2
-0
eval_apply.hpp
eval_apply.hpp
+2
-0
functions.cpp
functions.cpp
+16
-0
functions.hpp
functions.hpp
+5
-0
node_factory.hpp
node_factory.hpp
+2
-0
sass_interface.h
sass_interface.h
+2
-0
No files found.
context.hpp
View file @
d74cdbb2
#define SASS_CONTEXT
#define SASS_CONTEXT
#ifndef SASS_ENVIRONMENT
//
#ifndef SASS_ENVIRONMENT
#include "environment.hpp"
#include "environment.hpp"
#endif
//
#endif
#include <utility>
#include <utility>
#ifndef SASS_NODE_FACTORY
#include "node_factory.hpp"
#include "node_factory.hpp"
#endif
#ifndef SASS_FUNCTIONS
#include "functions.hpp"
#include "functions.hpp"
#endif
namespace
Sass
{
namespace
Sass
{
using
std
::
pair
;
using
std
::
pair
;
using
std
::
map
;
using
std
::
map
;
// struct Environment {
// map<Token, Node> current_frame;
// Environment* parent;
// Environment* global;
// Environment()
// : current_frame(map<Token, Node>()), parent(0), global(0)
// { }
// void link(Environment& env)
// {
// parent = &env;
// global = parent->global ? parent->global : parent;
// }
// bool query(const Token& key) const
// {
// if (current_frame.count(key)) return true;
// else if (parent) return parent->query(key);
// else return false;
// }
// Node& operator[](const Token& key)
// {
// if (current_frame.count(key)) return current_frame[key];
// else if (parent) return (*parent)[key];
// else return current_frame[key];
// }
// };
struct
Context
{
struct
Context
{
Environment
global_env
;
Environment
global_env
;
map
<
string
,
Function
>
function_env
;
map
<
string
,
Function
>
function_env
;
...
...
document.hpp
View file @
d74cdbb2
#define SASS_DOCUMENT
#include <map>
#include <map>
#ifndef SASS_PRELEXER
#ifndef SASS_PRELEXER
...
...
error.hpp
View file @
d74cdbb2
#define SASS_ERROR
namespace
Sass
{
namespace
Sass
{
struct
Error
{
struct
Error
{
...
...
eval_apply.hpp
View file @
d74cdbb2
#define SASS_EVAL_APPLY
#include <map>
#include <map>
#ifndef SASS_NODE
#ifndef SASS_NODE
...
...
functions.cpp
View file @
d74cdbb2
#ifndef SASS_PRELEXER
#ifndef SASS_PRELEXER
#include "prelexer.hpp"
#include "prelexer.hpp"
#endif
#endif
#include "node_factory.hpp"
#include "node_factory.hpp"
#include "functions.hpp"
#include "functions.hpp"
#include "context.hpp"
#include "error.hpp"
#include "error.hpp"
#include <iostream>
#include <iostream>
#include <cmath>
#include <cmath>
using
std
::
cerr
;
using
std
::
endl
;
using
std
::
cerr
;
using
std
::
endl
;
namespace
Sass
{
namespace
Sass
{
Function
::
Function
(
const
char
*
signature
,
Primitive
ip
,
Node_Factory
&
new_Node
)
{
//Document sig_doc(Document::make_from_source_chars(
}
namespace
Functions
{
namespace
Functions
{
static
void
throw_eval_error
(
string
message
,
string
path
,
size_t
line
)
static
void
throw_eval_error
(
string
message
,
string
path
,
size_t
line
)
...
@@ -19,6 +30,11 @@ namespace Sass {
...
@@ -19,6 +30,11 @@ namespace Sass {
throw
Error
(
Error
::
evaluation
,
path
,
line
,
message
);
throw
Error
(
Error
::
evaluation
,
path
,
line
,
message
);
}
}
extern
const
char
foo_sig
[]
=
"foo($x, $y, $z: hey hey)"
;
Node
foo
(
const
Node
parameters
,
Environment
&
bindings
,
Node_Factory
&
new_Node
)
{
return
Node
();
}
// RGB Functions ///////////////////////////////////////////////////////
// RGB Functions ///////////////////////////////////////////////////////
Function_Descriptor
rgb_descriptor
=
Function_Descriptor
rgb_descriptor
=
...
...
functions.hpp
View file @
d74cdbb2
#define SASS_FUNCTIONS
#include <cstring>
#include <cstring>
#include <map>
#include <map>
...
@@ -26,6 +28,7 @@ namespace Sass {
...
@@ -26,6 +28,7 @@ namespace Sass {
Function
()
Function
()
{
/* TO DO: set up the generic callback here */
}
{
/* TO DO: set up the generic callback here */
}
// for user-defined functions
Function
(
Node
def
)
Function
(
Node
def
)
:
name
(
def
[
0
].
to_string
()),
:
name
(
def
[
0
].
to_string
()),
parameters
(
def
[
1
]),
parameters
(
def
[
1
]),
...
@@ -42,6 +45,8 @@ namespace Sass {
...
@@ -42,6 +45,8 @@ namespace Sass {
primitive
(
0
),
primitive
(
0
),
overloaded
(
overloaded
)
overloaded
(
overloaded
)
{
}
{
}
Function
(
const
char
*
signature
,
Primitive
ip
,
Node_Factory
&
new_Node
);
Function
(
Function_Descriptor
d
,
Primitive
ip
,
Node_Factory
&
new_Node
)
Function
(
Function_Descriptor
d
,
Primitive
ip
,
Node_Factory
&
new_Node
)
:
name
(
d
[
0
]),
:
name
(
d
[
0
]),
...
...
node_factory.hpp
View file @
d74cdbb2
#define SASS_NODE_FACTORY
#include <vector>
#include <vector>
#ifndef SASS_NODE
#ifndef SASS_NODE
...
...
sass_interface.h
View file @
d74cdbb2
#define SASS_INTERFACE
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
{
extern
"C"
{
#endif
#endif
...
...
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