From def7011b3ec2f20cc195a4405198e03eb6c92b47 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 14 Mar 2009 23:34:57 +0100 Subject: [PATCH] Judge: Added function get_nl() for checking of an expected end of line. --- judge/judge.h | 1 + judge/token.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/judge/judge.h b/judge/judge.h index 8ba6adb..ac9d7e4 100644 --- a/judge/judge.h +++ b/judge/judge.h @@ -96,3 +96,4 @@ long int get_long(struct tokenizer *t); unsigned long int get_ulong(struct tokenizer *t); double get_double(struct tokenizer *t); long double get_long_double(struct tokenizer *t); +void get_nl(struct tokenizer *t); diff --git a/judge/token.c b/judge/token.c index 795cc08..4606395 100644 --- a/judge/token.c +++ b/judge/token.c @@ -163,3 +163,10 @@ GET(long, long int) GET(ulong, unsigned long int) GET(double, double) GET(long_double, long double) + +void get_nl(struct tokenizer *t) +{ + char *tok = get_token(t); + if (tok && *tok) + tok_err(t, "Expected end of line"); +} -- 2.39.5