aboutsummaryrefslogtreecommitdiff
path: root/src/git-parser.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-05-16 12:50:19 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-05-16 12:50:19 +0300
commit50e703a9a92e755f928699b705612cd4153ffb9f (patch)
tree4f1b4620217e1213d807631ceecf3a46efc30768 /src/git-parser.c
parentaa31497d9f0a3e96801d3752dd2d8f4ea20a2f4c (diff)
downloadgrecs-50e703a9a92e755f928699b705612cd4153ffb9f.tar.gz
grecs-50e703a9a92e755f928699b705612cd4153ffb9f.tar.bz2
Add tests for MeTA1 and Git parsers.
* src/git-parser.c: Hanlde end-of-line comments. * tests/Makefile.am (EXTRA_DIST): Add meta1.conf and git.conf (TESTSUITE_AT): Add parser-git.at and parser-meta1.at. * tests/testsuite.at: Include parser-git.at and parser-meta1.at. * tests/meta1.conf: New file. * tests/git.conf: New file. * tests/parser-git.at: New file. * tests/parser-meta1.at: New file. * tests/gcffmt.c (main): Handle -type= option.
Diffstat (limited to 'src/git-parser.c')
-rw-r--r--src/git-parser.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/git-parser.c b/src/git-parser.c
index e0675ef..117a8fc 100644
--- a/src/git-parser.c
+++ b/src/git-parser.c
@@ -47,7 +47,7 @@ struct token {
#define ISINITIAL(c) ((isascii(c) && isalpha(c)) || (c) == '_')
static int
-input()
+rawinput()
{
if (!infile || feof(infile))
return 0;
@@ -57,6 +57,17 @@ input()
return input_char;
}
+static int
+input()
+{
+ rawinput();
+ if (input_char == '#') {
+ while (rawinput() && input_char != '\n')
+ ;
+ }
+ return input_char;
+}
+
static void
unput()
{
@@ -87,7 +98,7 @@ collect_tag()
static void
collect_string()
{
- while (input()) {
+ while (rawinput()) {
if (input_char == '\\') {
if (!input()) {
grecs_error(&grecs_current_locus, 0,

Return to:

Send suggestions and report system problems to the System administrator.