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
f99b3c6b
Commit
f99b3c6b
authored
Apr 18, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Foundations of value schemas (i.e., embedded interpolants).
parent
f8627553
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
3 deletions
+26
-3
document_parser.cpp
document_parser.cpp
+8
-2
interpolation.scss
interpolation.scss
+7
-1
prelexer.cpp
prelexer.cpp
+9
-0
prelexer.hpp
prelexer.hpp
+2
-0
No files found.
document_parser.cpp
View file @
f99b3c6b
...
...
@@ -670,7 +670,13 @@ namespace Sass {
return
result
;
}
if
(
lex
<
true_kwd
>
())
if
(
lex
<
value_schema
>
())
{
// TO DO: handle value schemas!
return
Node
(
Node
::
identifier
,
line_number
,
lexed
);
}
if
(
lex
<
sequence
<
true_kwd
,
negate
<
identifier
>
>
>
())
{
Node
T
(
Node
::
boolean
);
T
.
line_number
=
line_number
;
...
...
@@ -678,7 +684,7 @@ namespace Sass {
return
T
;
}
if
(
lex
<
false_kwd
>
())
if
(
lex
<
sequence
<
false_kwd
,
negate
<
identifier
>
>
>
())
{
Node
F
(
Node
::
boolean
);
F
.
line_number
=
line_number
;
...
...
interpolation.scss
View file @
f99b3c6b
...
...
@@ -2,5 +2,10 @@ $x: bar;
div
{
a
:
blah
foo
#{
$x
}
;
b
:
1
+
123
#{
a
b
@
fuzzle
}
;
b
:
(
1
#{
2
+
3
}
)
+
4
;
b
:
(
1
(
2
+
3
))
+
4
;
c
:
1
#{
2
+
3
}
+
4
;
d
:
type-of
(
false
);
e
:
type-of
(
fa
#{
lse
}
);
e
:
12fa
#{
lse
}
345
;
}
\ No newline at end of file
prelexer.cpp
View file @
f99b3c6b
...
...
@@ -79,6 +79,15 @@ namespace Sass {
exactly
<
'-'
>
,
exactly
<
'_'
>
>
>
>
(
src
);
}
// Match interpolant schemas
const
char
*
value_schema
(
const
char
*
src
)
{
// follows this pattern: ([xyz]*i[xyz]*)+
return
one_plus
<
sequence
<
zero_plus
<
alternatives
<
identifier
,
number
>
>
,
interpolant
,
zero_plus
<
alternatives
<
identifier
,
number
>
>
>
>
(
src
);
}
// Match CSS '@' keywords.
const
char
*
at_keyword
(
const
char
*
src
)
{
return
sequence
<
exactly
<
'@'
>
,
identifier
>
(
src
);
...
...
prelexer.hpp
View file @
f99b3c6b
...
...
@@ -274,6 +274,8 @@ namespace Sass {
// Match a CSS identifier.
const
char
*
identifier
(
const
char
*
src
);
// Match interpolant schemas
const
char
*
value_schema
(
const
char
*
src
);
// Match CSS '@' keywords.
const
char
*
at_keyword
(
const
char
*
src
);
const
char
*
import
(
const
char
*
src
);
...
...
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