trainerproc: Parse line markers (#5122)

This commit is contained in:
Martin Griffin 2024-08-08 19:12:18 +01:00 committed by GitHub
parent 6bbc0601a9
commit a5e0738484
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17026 additions and 17015 deletions

View file

@ -346,7 +346,7 @@ sound/%.bin: sound/%.aif ; $(AIF) $< $@
COMPETITIVE_PARTY_SYNTAX := $(shell PATH="$(PATH)"; echo 'COMPETITIVE_PARTY_SYNTAX' | $(CPP) $(CPPFLAGS) -imacros include/global.h | tail -n1)
ifeq ($(COMPETITIVE_PARTY_SYNTAX),1)
%.h: %.party tools ; $(CPP) $(CPPFLAGS) -traditional-cpp - < $< | sed '/#[^p]/d' | $(TRAINERPROC) -o $@ -i $< -
%.h: %.party tools ; $(CPP) $(CPPFLAGS) -traditional-cpp - < $< | $(TRAINERPROC) -o $@ -i $< -
endif
ifeq ($(MODERN),0)

File diff suppressed because it is too large Load diff

View file

@ -425,12 +425,6 @@ static bool match_eol(struct Parser *p)
return true;
}
__attribute__((warn_unused_result))
static bool match_empty_line(struct Parser *p)
{
return match_eol(p);
}
__attribute__((warn_unused_result))
static bool match_int(struct Parser *p, int *i)
{
@ -457,6 +451,23 @@ static bool match_int(struct Parser *p, int *i)
return true;
}
__attribute__((warn_unused_result))
static bool match_empty_line(struct Parser *p)
{
struct Parser p_ = *p;
if (match_exact(&p_, "# ")) {
int line;
if (match_int(&p_, &line)) {
struct Token t;
match_until_eol(&p_, &t);
p_.location.line = line - 1;
*p = p_;
}
}
return match_eol(p);
}
__attribute__((warn_unused_result))
static bool match_identifier(struct Parser *p, struct Token *t)
{