aboutsummaryrefslogtreecommitdiff
path: root/src/git-parser.c
diff options
context:
space:
mode:
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
@@ -44,22 +44,33 @@ struct token {
#define ISSPACE(c) (strchr(" \t\r\f\n", c) != NULL)
#define ISIDENT(c) ((isascii(c) && isalnum(c)) || (c) == '_')
#define ISINITIAL(c) ((isascii(c) && isalpha(c)) || (c) == '_')
static int
-input()
+rawinput()
{
if (!infile || feof(infile))
return 0;
input_char = fgetc(infile);
if (input_char == '\n')
grecs_current_locus.line++;
return input_char;
}
+static int
+input()
+{
+ rawinput();
+ if (input_char == '#') {
+ while (rawinput() && input_char != '\n')
+ ;
+ }
+ return input_char;
+}
+
static void
unput()
{
if (!input_char)
return;
if (input_char == '\n')
@@ -84,13 +95,13 @@ collect_tag()
tok.tag = grecs_txtacc_finish(acc, 0);
}
static void
collect_string()
{
- while (input()) {
+ while (rawinput()) {
if (input_char == '\\') {
if (!input()) {
grecs_error(&grecs_current_locus, 0,
"unexpected EOF in string");
break;
}

Return to:

Send suggestions and report system problems to the System administrator.