lorid

convert chordpro to pdf
git clone git://git.relim.de/lorid.git
Log | Files | Refs | README | LICENSE

commit 7f549b221c9755a528a22377e9f5585c5a14bc1c
parent 0c3bba0c39399ed5f4beeb9ebb0727dd6d93b329
Author: nibo <nibo@relim.de>
Date:   Mon, 14 Oct 2024 11:03:29 +0200

Rename 'begin' to 'start' in case of tags

the html spec uses the terms 'start' and
'end' for tags instead of 'begin' and 'end'.

Diffstat:
Mchordpro.c | 16++++++++--------
Mchordpro.h | 2+-
2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/chordpro.c b/chordpro.c @@ -74,7 +74,7 @@ static const char *state_enums[] = { "STATE_DIRECTIVE_VALUE", "STATE_CHORD", "STATE_ANNOTATION", - "STATE_MARKUP_TAG_BEGIN", + "STATE_MARKUP_TAG_START", "STATE_MARKUP_TAG_END", "STATE_MARKUP_TAG", "STATE_MARKUP_ATTR_NAME", @@ -3243,7 +3243,7 @@ cho_songs_parse(FILE *fp, const char *chordpro_filepath, struct Config *config) return NULL; } if (buf == '\n') { - cho_log(LOG_ERR, "Can't have a newline in a directive value."); + cho_log(LOG_ERR, "Newline character inside a directive value is invalid."); return NULL; } directive_value[dv] = buf; @@ -3353,8 +3353,8 @@ cho_songs_parse(FILE *fp, const char *chordpro_filepath, struct Config *config) songs[so]->sections[se]->lines[li]->text_above[c]->u.annot->text[ann] = buf; ann++; break; - case STATE_MARKUP_TAG_BEGIN: - MARKUP_TAG_BEGIN: + case STATE_MARKUP_TAG_START: + MARKUP_TAG_START: if (buf == '>') { tag_start[t] = 0; t = 0; @@ -3400,7 +3400,7 @@ cho_songs_parse(FILE *fp, const char *chordpro_filepath, struct Config *config) return NULL; } if (t == 5) { - cho_log(LOG_ERR, "Begin tag name is too long."); + cho_log(LOG_ERR, "Start tag name is too long."); return NULL; } tag_start[t] = buf; @@ -3414,9 +3414,9 @@ cho_songs_parse(FILE *fp, const char *chordpro_filepath, struct Config *config) ta++; tags = realloc(tags, (ta+1) * sizeof(struct Tag *)); tags[ta] = cho_tag_new(); - state = STATE_MARKUP_TAG_BEGIN; - // INFO: If we don't use 'goto' we loose the first character of the begin tag name - goto MARKUP_TAG_BEGIN; + state = STATE_MARKUP_TAG_START; + // INFO: If we don't use 'goto' we loose the first character of the start tag name + goto MARKUP_TAG_START; case STATE_MARKUP_TAG_END: if (buf == '>') { tag_end[t] = 0; diff --git a/chordpro.h b/chordpro.h @@ -164,7 +164,7 @@ enum State { STATE_DIRECTIVE_VALUE, STATE_CHORD, STATE_ANNOTATION, - STATE_MARKUP_TAG_BEGIN, + STATE_MARKUP_TAG_START, STATE_MARKUP_TAG_END, STATE_MARKUP_TAG, STATE_MARKUP_ATTR_NAME,