-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
98 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
int test_lexer(test_chain_t *chain) | ||
{ | ||
const char *line = chain->line; | ||
t_t *t = t_create(); | ||
char quote = 0; | ||
int error = 0; | ||
|
||
while (*line && !error) | ||
{ | ||
const char *start = test_skip_space(line); | ||
test_t *test = test_find_test(start); | ||
const char *end = line; | ||
|
||
if (test->test) | ||
{ | ||
end = process_test(chain, &t, test, start); | ||
} | ||
else | ||
{ | ||
end = test_skip_any(start, "e); | ||
if (end - start > 0) | ||
{ | ||
if (!t->test && | ||
(t->test_type == MACRO_TEST_0 || | ||
t->test_type == MACRO_TEST_1 || | ||
t->test_type == MACRO_TEST_2 || | ||
t->test_type == MACRO_TEST_3)) | ||
{ | ||
t->test = hstrndup(start, end - start); | ||
} | ||
else | ||
{ | ||
ARRAY_ADD(t->v, hstrndup(start, end - start), V_BUFFER_SIZE); | ||
} | ||
} | ||
else if (*end) | ||
{ | ||
end++; | ||
} | ||
} | ||
line = end; | ||
} | ||
if (error) | ||
{ | ||
hprintf("parsing error @ %s", line); | ||
} | ||
ARRAY_ADD(t->v, NULL, V_BUFFER_SIZE); | ||
ARRAY_ADD(chain->root.tests, t, 2); | ||
ARRAY_ADD(chain->root.tests, NULL, 1); | ||
return (!quote); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
tests/style/functions/functions6.c:43: WARNING: More than 40 lines in a function | ||
tests/style/functions/functions6.c:44: WARNING: More than 40 lines in a function | ||
tests/style/functions/functions6.c:45: WARNING: More than 40 lines in a function | ||
tests/style/functions/functions6.c:46: WARNING: More than 40 lines in a function | ||
tests/style/functions/functions6.c:47: WARNING: More than 40 lines in a function | ||
tests/style/functions/functions6.c:48: WARNING: More than 40 lines in a function | ||
tests/style/functions/functions6.c:49: WARNING: More than 40 lines in a function | ||
tests/style/functions/functions6.c:50: WARNING: More than 40 lines in a function | ||
total: 0 errors, 8 warnings, 51 lines checked |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
static const char *test( | ||
test_chain_t (*chain)(int), | ||
test_t **cmd, | ||
token_t *token, | ||
const char *start) | ||
{ | ||
return (start); | ||
} |
Empty file.