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
bf9bed27
Commit
bf9bed27
authored
Feb 17, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Damn typos in my macros.
parent
521c6ff8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
+10
-12
lexical_patterns.c
src/text/lexical_patterns.c
+3
-4
prefix_primitives.h
src/text/prefix_primitives.h
+2
-3
test.c
src/text/test.c
+5
-5
No files found.
src/text/lexical_patterns.c
View file @
bf9bed27
#include <stdio.h>
#include "lexical_patterns.h"
//#include "prefix_primitives.h"
static
SEQUENCE_MATCHER
(
hyphen_and_id
,
prefix_is_hyphe
n
,
prefix_is_identifier
);
static
ALTERNATIVES_MATCHER
(
word_initial
,
prefix_is_identifier
,
prefix_is_
hyphen_and_id
);
static
ALTERNATIVES_MATCHER
(
word_trailer
,
prefix_is_identifier
,
prefix_is_
hyphe
n
,
prefix_is_digits
);
static
SEQUENCE_MATCHER
(
sign_and_identifier
,
prefix_is_sig
n
,
prefix_is_identifier
);
static
ALTERNATIVES_MATCHER
(
word_initial
,
prefix_is_identifier
,
prefix_is_
sign_and_identifier
);
static
ALTERNATIVES_MATCHER
(
word_trailer
,
prefix_is_identifier
,
prefix_is_
sig
n
,
prefix_is_digits
);
FIRST_REST_MATCHER
(
word
,
prefix_is_word_initial
,
prefix_is_word_trailer
);
src/text/prefix_primitives.h
View file @
bf9bed27
...
...
@@ -14,12 +14,12 @@ char *prefix_is_ ## name(char *src) { \
}
#define CLASS_CHAR_MATCHER(name, class) \
char *prefix_is ## name(char *src) { \
char *prefix_is
_
## name(char *src) { \
return prefix_is_one_of(src, class); \
}
#define CLASS_CHARS_MATCHER(name, class) \
char *prefix_is ## name(char *src) { \
char *prefix_is
_
## name(char *src) { \
return prefix_is_some_of(src, class); \
}
...
...
@@ -148,7 +148,6 @@ DECLARE(eq);
DECLARE
(
assign
);
DECLARE
(
equal
);
char
*
prefix_is_sign
(
char
*
);
DECLARE
(
sign
);
DECLARE
(
delimiter
);
...
...
src/text/test.c
View file @
bf9bed27
...
...
@@ -2,8 +2,8 @@
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include "prefix_primitives.h"
//
#include "lexical_patterns.h"
//
#include "prefix_primitives.h"
#include "lexical_patterns.h"
void
print_slice
(
char
*
s
,
char
*
t
)
{
if
(
t
)
{
...
...
@@ -33,7 +33,7 @@ int main() {
char
*
words
=
"hello my name is aaron"
;
char
*
id1
=
"_identifier123{blah bloo}"
;
char
*
non_id
=
"12non_ident_ifier_"
;
char
*
word2
=
"-blah-bl
ah_bl12-34
:foo"
;
char
*
word2
=
"-blah-bl
+ah_bl12-34+1
:foo"
;
char
*
non_word
=
"-12blah-bloo"
;
char
*
selector
=
"#foo > :first-child { color: #abcdef; }"
;
char
*
lcomment
=
"// blah blah blah // end
\n
blah blah"
;
...
...
@@ -100,8 +100,8 @@ int main() {
test1
(
prefix_is_integer
,
integer3
);
test1
(
prefix_is_integer
,
word2
);
//
test1(prefix_is_word, word2);
// test1(prefix_is_word, non_word
);
test1
(
prefix_is_word
,
word2
);
test1
(
prefix_is_word
,
integer3
);
return
0
;
}
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