mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-25 04:22:07 +00:00
Fix whitespace
Replace spaces by tabs for consistency. The rest of the codebase uses tabs, so the linkerscript parser has to change. Removed trailing tabs in all codebase. Signed-off-by: AntonioND <antonio_nd@outlook.com>
This commit is contained in:
@@ -44,52 +44,52 @@ static int nline = 1;
|
||||
%%
|
||||
|
||||
lines:
|
||||
/* empty */
|
||||
| lines line NEWLINE
|
||||
;
|
||||
/* empty */
|
||||
| lines line NEWLINE
|
||||
;
|
||||
|
||||
line:
|
||||
/* empty */ { nline++; }
|
||||
| statement { nline++; }
|
||||
;
|
||||
/* empty */ { nline++; }
|
||||
| statement { nline++; }
|
||||
;
|
||||
|
||||
statement:
|
||||
/* Statements to set the current section */
|
||||
SECTION_NONBANKED {
|
||||
script_SetCurrentSectionType($1, 0);
|
||||
}
|
||||
| SECTION_NONBANKED INTEGER {
|
||||
errx(1, "%d:Trying to assign a bank to a non-banked section.\n", nline);
|
||||
}
|
||||
/* Statements to set the current section */
|
||||
SECTION_NONBANKED {
|
||||
script_SetCurrentSectionType($1, 0);
|
||||
}
|
||||
| SECTION_NONBANKED INTEGER {
|
||||
errx(1, "%d:Trying to assign a bank to a non-banked section.\n", nline);
|
||||
}
|
||||
|
||||
| SECTION_BANKED {
|
||||
errx(1, "%d:Banked section without assigned bank.\n", nline);
|
||||
}
|
||||
| SECTION_BANKED INTEGER {
|
||||
script_SetCurrentSectionType($1, $2);
|
||||
}
|
||||
| SECTION_BANKED {
|
||||
errx(1, "%d:Banked section without assigned bank.\n", nline);
|
||||
}
|
||||
| SECTION_BANKED INTEGER {
|
||||
script_SetCurrentSectionType($1, $2);
|
||||
}
|
||||
|
||||
/* Commands to adjust the address inside the current section */
|
||||
| COMMAND_ALIGN INTEGER {
|
||||
script_SetAlignment($2);
|
||||
}
|
||||
| COMMAND_ALIGN {
|
||||
errx(1, "%d:ALIGN keyword needs an argument.\n", nline);
|
||||
}
|
||||
| COMMAND_ORG INTEGER {
|
||||
script_SetAddress($2);
|
||||
}
|
||||
| COMMAND_ORG {
|
||||
errx(1, "%d:ORG keyword needs an argument.\n", nline);
|
||||
}
|
||||
/* Commands to adjust the address inside the current section */
|
||||
| COMMAND_ALIGN INTEGER {
|
||||
script_SetAlignment($2);
|
||||
}
|
||||
| COMMAND_ALIGN {
|
||||
errx(1, "%d:ALIGN keyword needs an argument.\n", nline);
|
||||
}
|
||||
| COMMAND_ORG INTEGER {
|
||||
script_SetAddress($2);
|
||||
}
|
||||
| COMMAND_ORG {
|
||||
errx(1, "%d:ORG keyword needs an argument.\n", nline);
|
||||
}
|
||||
|
||||
/* Section name */
|
||||
| STRING {
|
||||
script_OutputSection($1);
|
||||
}
|
||||
/* Section name */
|
||||
| STRING {
|
||||
script_OutputSection($1);
|
||||
}
|
||||
|
||||
/* End */
|
||||
;
|
||||
/* End */
|
||||
;
|
||||
|
||||
%%
|
||||
|
||||
@@ -100,24 +100,24 @@ extern FILE *yyin;
|
||||
|
||||
void yyerror(char *s)
|
||||
{
|
||||
errx(1, "%d:Linkerscript parse error: \"%s\"\n", nline, s);
|
||||
errx(1, "%d:Linkerscript parse error: \"%s\"\n", nline, s);
|
||||
}
|
||||
|
||||
void script_Parse(const char *path)
|
||||
{
|
||||
script_InitSections();
|
||||
script_InitSections();
|
||||
|
||||
FILE *f = fopen(path, "r");
|
||||
FILE *f = fopen(path, "r");
|
||||
|
||||
if (!f)
|
||||
errx(1, "Error opening file! \"%s\"\n", path);
|
||||
if (!f)
|
||||
errx(1, "Error opening file! \"%s\"\n", path);
|
||||
|
||||
yyin = f;
|
||||
yyin = f;
|
||||
|
||||
do {
|
||||
yyparse();
|
||||
} while (!feof(yyin));
|
||||
do {
|
||||
yyparse();
|
||||
} while (!feof(yyin));
|
||||
|
||||
fclose(f);
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user