tweaks: rename a type, for more contrast
parent
5817e83e33
commit
923a90cba0
|
@ -217,23 +217,23 @@ typedef struct regexlisttype {
|
||||||
/* The next regex. */
|
/* The next regex. */
|
||||||
} regexlisttype;
|
} regexlisttype;
|
||||||
|
|
||||||
typedef struct extendsyntaxstruct {
|
typedef struct augmentstruct {
|
||||||
char *filename;
|
char *filename;
|
||||||
/* The file where the syntax is extended. */
|
/* The file where the syntax is extended. */
|
||||||
ssize_t lineno;
|
ssize_t lineno;
|
||||||
/* The number of the line of the extendsyntax command. */
|
/* The number of the line of the extendsyntax command. */
|
||||||
char *data;
|
char *data;
|
||||||
/* The text of the line. */
|
/* The text of the line. */
|
||||||
struct extendsyntaxstruct *next;
|
struct augmentstruct *next;
|
||||||
/* Next node. */
|
/* Next node. */
|
||||||
} extendsyntaxstruct;
|
} augmentstruct;
|
||||||
|
|
||||||
typedef struct syntaxtype {
|
typedef struct syntaxtype {
|
||||||
char *name;
|
char *name;
|
||||||
/* The name of this syntax. */
|
/* The name of this syntax. */
|
||||||
char *filename;
|
char *filename;
|
||||||
/* File where the syntax is defined, or NULL if not an included file. */
|
/* 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. */
|
/* List of extendsyntax commands to apply when loaded. */
|
||||||
regexlisttype *extensions;
|
regexlisttype *extensions;
|
||||||
/* The list of extensions that this syntax applies to. */
|
/* The list of extensions that this syntax applies to. */
|
||||||
|
|
|
@ -582,11 +582,11 @@ void parse_one_include(char *file, syntaxtype *syntax)
|
||||||
while (lastcolor->next != NULL)
|
while (lastcolor->next != NULL)
|
||||||
lastcolor = lastcolor->next;
|
lastcolor = lastcolor->next;
|
||||||
|
|
||||||
extendsyntaxstruct *es = syntax->extendsyntax;
|
augmentstruct *es = syntax->extendsyntax;
|
||||||
|
|
||||||
/* Apply any stored extendsyntax commands. */
|
/* Apply any stored extendsyntax commands. */
|
||||||
while (es != NULL) {
|
while (es != NULL) {
|
||||||
extendsyntaxstruct *next = es->next;
|
augmentstruct *next = es->next;
|
||||||
char *keyword = es->data, *ptr = parse_next_word(es->data);
|
char *keyword = es->data, *ptr = parse_next_word(es->data);
|
||||||
|
|
||||||
nanorc = es->filename;
|
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. */
|
/* When the syntax isn't loaded yet, store extendsyntax commands. */
|
||||||
if (sint->filename != NULL) {
|
if (sint->filename != NULL) {
|
||||||
extendsyntaxstruct *newextendsyntax = nmalloc(sizeof(extendsyntaxstruct));;
|
augmentstruct *newextendsyntax = nmalloc(sizeof(augmentstruct));;
|
||||||
|
|
||||||
newextendsyntax->filename = strdup(nanorc);
|
newextendsyntax->filename = strdup(nanorc);
|
||||||
newextendsyntax->lineno = lineno;
|
newextendsyntax->lineno = lineno;
|
||||||
|
@ -1057,7 +1057,8 @@ void parse_rcfile(FILE *rcstream, bool syntax_only, bool headers_only)
|
||||||
newextendsyntax->next = NULL;
|
newextendsyntax->next = NULL;
|
||||||
|
|
||||||
if (sint->extendsyntax != NULL) {
|
if (sint->extendsyntax != NULL) {
|
||||||
extendsyntaxstruct *es = sint->extendsyntax;
|
augmentstruct *es = sint->extendsyntax;
|
||||||
|
|
||||||
while (es->next != NULL)
|
while (es->next != NULL)
|
||||||
es = es->next;
|
es = es->next;
|
||||||
es->next = newextendsyntax;
|
es->next = newextendsyntax;
|
||||||
|
|
Loading…
Reference in New Issue