tweaks: rename a type, for more contrast

master
Benno Schulenberg 2019-05-31 12:16:55 +02:00
parent 5817e83e33
commit 923a90cba0
2 changed files with 9 additions and 8 deletions

View File

@ -217,23 +217,23 @@ typedef struct regexlisttype {
/* The next regex. */
} regexlisttype;
typedef struct extendsyntaxstruct {
typedef struct augmentstruct {
char *filename;
/* The file where the syntax is extended. */
ssize_t lineno;
/* The number of the line of the extendsyntax command. */
char *data;
/* The text of the line. */
struct extendsyntaxstruct *next;
struct augmentstruct *next;
/* Next node. */
} extendsyntaxstruct;
} augmentstruct;
typedef struct syntaxtype {
char *name;
/* The name of this syntax. */
char *filename;
/* File where the syntax is defined, or NULL if not an included file. */
struct extendsyntaxstruct *extendsyntax;
struct augmentstruct *extendsyntax;
/* List of extendsyntax commands to apply when loaded. */
regexlisttype *extensions;
/* The list of extensions that this syntax applies to. */

View File

@ -582,11 +582,11 @@ void parse_one_include(char *file, syntaxtype *syntax)
while (lastcolor->next != NULL)
lastcolor = lastcolor->next;
extendsyntaxstruct *es = syntax->extendsyntax;
augmentstruct *es = syntax->extendsyntax;
/* Apply any stored extendsyntax commands. */
while (es != NULL) {
extendsyntaxstruct *next = es->next;
augmentstruct *next = es->next;
char *keyword = es->data, *ptr = parse_next_word(es->data);
nanorc = es->filename;
@ -1049,7 +1049,7 @@ void parse_rcfile(FILE *rcstream, bool syntax_only, bool headers_only)
/* When the syntax isn't loaded yet, store extendsyntax commands. */
if (sint->filename != NULL) {
extendsyntaxstruct *newextendsyntax = nmalloc(sizeof(extendsyntaxstruct));;
augmentstruct *newextendsyntax = nmalloc(sizeof(augmentstruct));;
newextendsyntax->filename = strdup(nanorc);
newextendsyntax->lineno = lineno;
@ -1057,7 +1057,8 @@ void parse_rcfile(FILE *rcstream, bool syntax_only, bool headers_only)
newextendsyntax->next = NULL;
if (sint->extendsyntax != NULL) {
extendsyntaxstruct *es = sint->extendsyntax;
augmentstruct *es = sint->extendsyntax;
while (es->next != NULL)
es = es->next;
es->next = newextendsyntax;