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
5eac82d3
Commit
5eac82d3
authored
Apr 09, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allowing the parser to parse an arbitrary interval rather than all the way to the null terminator.
parent
5a78adc0
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
1 deletions
+13
-1
document.cpp
document.cpp
+10
-0
document.hpp
document.hpp
+2
-0
document_parser.cpp
document_parser.cpp
+1
-1
No files found.
document.cpp
View file @
5eac82d3
...
...
@@ -23,6 +23,7 @@ namespace Sass {
source
=
new
char
[
len
+
1
];
std
::
fread
(
source
,
sizeof
(
char
),
len
,
f
);
source
[
len
]
=
'\0'
;
end
=
source
+
len
;
std
::
fclose
(
f
);
own_source
=
true
;
}
...
...
@@ -48,12 +49,21 @@ namespace Sass {
source
=
new
char
[
len
+
1
];
std
::
fread
(
source
,
sizeof
(
char
),
len
,
f
);
source
[
len
]
=
'\0'
;
end
=
source
+
len
;
std
::
fclose
(
f
);
position
=
source
;
context
.
source_refs
.
push_back
(
source
);
++
context
.
ref_count
;
}
Document
::
Document
(
Token
t
,
Context
&
context
)
:
context
(
context
)
{
}
Document
::~
Document
()
{
--
context
.
ref_count
;
if
(
context
.
ref_count
==
0
)
delete
&
context
;
...
...
document.hpp
View file @
5eac82d3
...
...
@@ -18,6 +18,7 @@ namespace Sass {
string
path
;
char
*
source
;
const
char
*
position
;
const
char
*
end
;
size_t
line_number
;
bool
own_source
;
...
...
@@ -28,6 +29,7 @@ namespace Sass {
Document
(
string
path
,
char
*
source
=
0
);
Document
(
string
path
,
Context
&
context
);
Document
(
Token
t
,
Context
&
context
);
~
Document
();
template
<
prelexer
mx
>
...
...
document_parser.cpp
View file @
5eac82d3
...
...
@@ -8,7 +8,7 @@ namespace Sass {
{
lex
<
optional_spaces
>
();
root
<<
Node
(
Node
::
flags
);
while
(
*
position
)
{
while
(
position
<
end
)
{
if
(
lex
<
block_comment
>
())
{
root
<<
Node
(
Node
::
comment
,
line_number
,
lexed
);
}
...
...
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