projects
/
carl9170fw.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
kconfig: allow use of relations other than (in)equality
[carl9170fw.git]
/
config
/
zconf.l
diff --git
a/config/zconf.l
b/config/zconf.l
index a2b289519df6139ca2f029e50dba256d2f3b57b3..020c099a3a6568190a5584db7245e8f53a1f3760 100644
(file)
--- a/
config/zconf.l
+++ b/
config/zconf.l
@@
-27,8
+27,8
@@
static char *text;
static int text_size, text_asize;
struct buffer {
static int text_size, text_asize;
struct buffer {
-
struct buffer *parent;
-
YY_BUFFER_STATE state;
+ struct buffer *parent;
+ YY_BUFFER_STATE state;
};
struct buffer *current_buf;
};
struct buffer *current_buf;
@@
-40,7
+40,7
@@
static void zconf_endfile(void);
static void new_string(void)
{
static void new_string(void)
{
- text = malloc(START_STRSIZE);
+ text =
x
malloc(START_STRSIZE);
text_asize = START_STRSIZE;
text_size = 0;
*text = 0;
text_asize = START_STRSIZE;
text_size = 0;
*text = 0;
@@
-62,13
+62,12
@@
static void append_string(const char *str, int size)
static void alloc_string(const char *str, int size)
{
static void alloc_string(const char *str, int size)
{
- text = malloc(size + 1);
+ text =
x
malloc(size + 1);
memcpy(text, str, size);
text[size] = 0;
}
%}
memcpy(text, str, size);
text[size] = 0;
}
%}
-ws [ \n\t]
n [A-Za-z0-9_]
%%
n [A-Za-z0-9_]
%%
@@
-123,6
+122,10
@@
n [A-Za-z0-9_]
"!" return T_NOT;
"=" return T_EQUAL;
"!=" return T_UNEQUAL;
"!" return T_NOT;
"=" return T_EQUAL;
"!=" return T_UNEQUAL;
+ "<=" return T_LESS_EQUAL;
+ ">=" return T_GREATER_EQUAL;
+ "<" return T_LESS;
+ ">" return T_GREATER;
\"|\' {
str = yytext[0];
new_string();
\"|\' {
str = yytext[0];
new_string();
@@
-142,7
+145,12
@@
n [A-Za-z0-9_]
}
#.* /* comment */
\\\n current_file->lineno++;
}
#.* /* comment */
\\\n current_file->lineno++;
- .
+ [[:blank:]]+
+ . {
+ fprintf(stderr,
+ "%s:%d:warning: ignoring unsupported character '%c'\n",
+ zconf_curname(), zconf_lineno(), *yytext);
+ }
<<EOF>> {
BEGIN(INITIAL);
}
<<EOF>> {
BEGIN(INITIAL);
}
@@
-288,7
+296,7
@@
void zconf_initscan(const char *name)
exit(1);
}
exit(1);
}
- current_buf = malloc(sizeof(*current_buf));
+ current_buf =
x
malloc(sizeof(*current_buf));
memset(current_buf, 0, sizeof(*current_buf));
current_file = file_lookup(name);
memset(current_buf, 0, sizeof(*current_buf));
current_file = file_lookup(name);
@@
-299,7
+307,7
@@
void zconf_nextfile(const char *name)
{
struct file *iter;
struct file *file = file_lookup(name);
{
struct file *iter;
struct file *file = file_lookup(name);
- struct buffer *buf = malloc(sizeof(*buf));
+ struct buffer *buf =
x
malloc(sizeof(*buf));
memset(buf, 0, sizeof(*buf));
current_buf->state = YY_CURRENT_BUFFER;
memset(buf, 0, sizeof(*buf));
current_buf->state = YY_CURRENT_BUFFER;