rgbasm: improve (some) pathological spacing.

This commit is contained in:
Anthony J. Bentley
2015-01-22 21:09:10 -07:00
parent c75b9d4d55
commit 4f8cf84ed4

View File

@@ -497,64 +497,60 @@ void if_skip_to_endc( void )
%% %%
asmfile : lines lastline asmfile : lines lastline;
;
lastline : /* empty */ lastline : /* empty */
| line | line {
{ nLineNo+=1; nTotalLines+=1; } nLineNo += 1;
; nTotalLines += 1;
};
lines : /* empty */ lines : /* empty */
| lines line '\n' | lines line '\n' {
{ nLineNo+=1; nTotalLines+=1; } nLineNo += 1;
; nTotalLines += 1;
};
line : /* empty */ line : /* empty */
| label | label
| label cpu_command | label cpu_command
| label macro | label macro
| label simple_pseudoop | label simple_pseudoop
| pseudoop | pseudoop;
;
label : /* empty */ label : /* empty */
| T_LABEL { if( $1[0]=='.' ) | T_LABEL {
if ($1[0] == '.')
sym_AddLocalReloc($1); sym_AddLocalReloc($1);
else else
sym_AddReloc($1); sym_AddReloc($1);
} } | T_LABEL ':' {
| T_LABEL ':' { if( $1[0]=='.' ) if ($1[0] == '.')
sym_AddLocalReloc($1); sym_AddLocalReloc($1);
else else
sym_AddReloc($1); sym_AddReloc($1);
} } | T_LABEL ':' ':' {
| T_LABEL ':' ':' { sym_AddReloc($1); sym_Export($1); } sym_AddReloc($1);
; sym_Export($1);
};
macro : T_ID macro : T_ID {
{ yy_set_state(LEX_STATE_MACROARGS);
yy_set_state( LEX_STATE_MACROARGS ); } macroargs {
} yy_set_state(LEX_STATE_NORMAL);
macroargs
{
yy_set_state( LEX_STATE_NORMAL );
if( !fstk_RunMacro($1) ) if (!fstk_RunMacro($1)) {
{
yyerror("Macro '%s' not defined", $1); yyerror("Macro '%s' not defined", $1);
} }
} };
;
macroargs : /* empty */ macroargs : /* empty */
| macroarg | macroarg
| macroarg ',' macroargs | macroarg ',' macroargs;
;
macroarg : T_STRING macroarg : T_STRING {
{ sym_AddNewMacroArg( $1 ); } sym_AddNewMacroArg($1);
; };
pseudoop : equ pseudoop : equ
| set | set
@@ -562,8 +558,7 @@ pseudoop : equ
| rw | rw
| rl | rl
| equs | equs
| macrodef | macrodef;
;
simple_pseudoop : include simple_pseudoop : include
| printf | printf
@@ -593,52 +588,44 @@ simple_pseudoop : include
| pushs | pushs
| popo | popo
| pusho | pusho
| opt | opt;
;
opt : T_POP_OPT opt : T_POP_OPT {
{ yy_set_state(LEX_STATE_MACROARGS);
yy_set_state( LEX_STATE_MACROARGS ); } opt_list {
} yy_set_state(LEX_STATE_NORMAL);
opt_list };
{
yy_set_state( LEX_STATE_NORMAL );
}
;
opt_list : opt_list_entry opt_list : opt_list_entry
| opt_list_entry ',' opt_list | opt_list_entry ',' opt_list;
;
opt_list_entry : T_STRING opt_list_entry : T_STRING {
{
opt_Parse($1); opt_Parse($1);
} };
;
popo : T_POP_POPO popo : T_POP_POPO {
{ opt_Pop(); } opt_Pop();
; };
pusho : T_POP_PUSHO pusho : T_POP_PUSHO {
{ opt_Push(); } opt_Push();
; };
pops : T_POP_POPS pops : T_POP_POPS {
{ out_PopSection(); } out_PopSection();
; };
pushs : T_POP_PUSHS pushs : T_POP_PUSHS {
{ out_PushSection(); } out_PushSection();
; };
fail : T_POP_FAIL string fail : T_POP_FAIL string {
{ fatalerror("%s", $2); } fatalerror("%s", $2);
; };
warn : T_POP_WARN string warn : T_POP_WARN string {
{ yyerror("%s", $2); } yyerror("%s", $2);
; };
shift : T_POP_SHIFT shift : T_POP_SHIFT
{ sym_ShiftCurrentMacroArgs(); } { sym_ShiftCurrentMacroArgs(); }