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
81ac5275
Commit
81ac5275
authored
Mar 15, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Functions for matching pathnames.
parent
d235ff2d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
prelexer.cpp
prelexer.cpp
+5
-2
prelexer.hpp
prelexer.hpp
+7
-1
unit-test-prelexer.cpp
unit-test-prelexer.cpp
+2
-0
No files found.
prelexer.cpp
View file @
81ac5275
...
@@ -202,9 +202,11 @@ namespace Sass {
...
@@ -202,9 +202,11 @@ namespace Sass {
// Path matching functions.
// Path matching functions.
char
*
folder
(
char
*
src
)
{
char
*
folder
(
char
*
src
)
{
return
sequence
<
zero_plus
<
negate
<
exactly
<
'/'
>
>
>
,
return
sequence
<
zero_plus
<
any_char_except
<
'/'
>
>
,
exactly
<
'/'
>
>
(
src
);
exactly
<
'/'
>
>
(
src
);
}
}
char
*
folders
(
char
*
src
)
{
return
zero_plus
<
folder
>
(
src
);
}
}
}
}
}
\ No newline at end of file
prelexer.hpp
View file @
81ac5275
...
@@ -85,7 +85,12 @@ namespace Sass {
...
@@ -85,7 +85,12 @@ namespace Sass {
}
}
// Match any single character.
// Match any single character.
char
*
any_char
(
char
*
src
);
char
*
any_char
(
char
*
src
);
// Match any single character except the supplied one.
template
<
char
c
>
char
*
any_char_except
(
char
*
src
)
{
return
(
*
src
&&
*
src
!=
c
)
?
src
+
1
:
0
;
}
// Matches zero characters (always succeeds without consuming input).
// Matches zero characters (always succeeds without consuming input).
char
*
epsilon
(
char
*
);
char
*
epsilon
(
char
*
);
...
@@ -313,6 +318,7 @@ namespace Sass {
...
@@ -313,6 +318,7 @@ namespace Sass {
// Path matching functions.
// Path matching functions.
char
*
folder
(
char
*
src
);
char
*
folder
(
char
*
src
);
char
*
folders
(
char
*
src
);
// Utility functions for finding and counting characters in a string.
// Utility functions for finding and counting characters in a string.
template
<
char
c
>
template
<
char
c
>
...
...
unit-test-prelexer.cpp
View file @
81ac5275
...
@@ -106,6 +106,8 @@ int main() {
...
@@ -106,6 +106,8 @@ int main() {
check_twice
(
binomial
,
bi2
,
nonbi1
);
check_twice
(
binomial
,
bi2
,
nonbi1
);
check_twice
(
folder
,
fld1
,
nonfld1
);
check_twice
(
folder
,
fld1
,
nonfld1
);
check_twice
(
folder
,
fld2
,
nonfld1
);
check_twice
(
folder
,
fld2
,
nonfld1
);
check_twice
(
folders
,
fld1
,
nonfld1
);
check_twice
(
folders
,
fld2
,
nonfld1
);
cout
<<
count_interval
<
'\n'
>
(
ws1
,
spaces_and_comments
(
ws1
))
<<
endl
;
cout
<<
count_interval
<
'\n'
>
(
ws1
,
spaces_and_comments
(
ws1
))
<<
endl
;
cout
<<
count_interval
<
'*'
>
(
ws1
,
spaces_and_comments
(
ws1
))
<<
endl
;
cout
<<
count_interval
<
'*'
>
(
ws1
,
spaces_and_comments
(
ws1
))
<<
endl
;
cout
<<
count_interval
<
exactly
<
slash_star
>
>
(
ws1
,
spaces_and_comments
(
ws1
))
<<
endl
;
cout
<<
count_interval
<
exactly
<
slash_star
>
>
(
ws1
,
spaces_and_comments
(
ws1
))
<<
endl
;
...
...
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