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
7eb9753c
Commit
7eb9753c
authored
Mar 15, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Const correctness!
parent
193110d6
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
2 deletions
+40
-2
prelexer.cpp
prelexer.cpp
+0
-0
prelexer.hpp
prelexer.hpp
+0
-0
token.cpp
token.cpp
+38
-1
token.hpp
token.hpp
+2
-1
No files found.
prelexer.cpp
View file @
7eb9753c
This diff is collapsed.
Click to expand it.
prelexer.hpp
View file @
7eb9753c
This diff is collapsed.
Click to expand it.
token.cpp
View file @
7eb9753c
...
...
@@ -5,7 +5,44 @@ namespace Sass {
Token
::
Token
(
const
char
*
begin
,
const
char
*
end
)
:
begin
(
begin
),
end
(
end
)
{
}
void
Token
::
stream_unquoted
(
std
::
stringstream
&
buf
)
const
{
string
Token
::
unquote
()
const
{
string
result
;
const
char
*
p
=
begin
;
if
(
*
begin
==
'\''
||
*
begin
==
'"'
)
{
++
p
;
while
(
p
<
end
)
{
if
(
*
p
==
'\\'
)
{
switch
(
*
(
++
p
))
{
case
'n'
:
result
+=
'\n'
;
break
;
case
't'
:
result
+=
'\t'
;
break
;
case
'b'
:
result
+=
'\b'
;
break
;
case
'r'
:
result
+=
'\r'
;
break
;
case
'f'
:
result
+=
'\f'
;
break
;
case
'v'
:
result
+=
'\v'
;
break
;
case
'a'
:
result
+=
'\a'
;
break
;
case
'\\'
:
result
+=
'\\'
;
break
;
default
:
result
+=
*
p
;
break
;
}
}
else
if
(
p
==
end
-
1
)
{
return
result
;
}
else
{
result
+=
*
p
;
}
++
p
;
}
return
result
;
}
else
{
while
(
p
<
end
)
{
result
+=
*
(
p
++
);
}
return
result
;
}
}
void
Token
::
unquote_to_stream
(
std
::
stringstream
&
buf
)
const
{
const
char
*
p
=
begin
;
if
(
*
begin
==
'\''
||
*
begin
==
'"'
)
{
++
p
;
...
...
token.hpp
View file @
7eb9753c
...
...
@@ -15,7 +15,8 @@ namespace Sass {
inline
operator
string
()
const
{
return
string
(
begin
,
end
-
begin
);
}
void
stream_unquoted
(
std
::
stringstream
&
buf
)
const
;
string
unquote
()
const
;
void
unquote_to_stream
(
std
::
stringstream
&
buf
)
const
;
bool
operator
<
(
const
Token
&
rhs
)
const
;
...
...
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