scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit 06dd27e58615dac53f3c5ea5e375f596f9b4c373
parent 09e34e600fe8592e5781c235e51a985627a37295
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Fri, 29 Dec 2017 08:44:18 +0000

[as] Don't include ^ in the rules regexs

It is better to add it in the awk code instead of having it
in all the rule definitions.

Diffstat:
Mas/target/gen.awk | 2+-
Mas/target/x80/rules.dat | 74+++++++++++++++++++++++++++++++++++++-------------------------------------
2 files changed, 38 insertions(+), 38 deletions(-)

diff --git a/as/target/gen.awk b/as/target/gen.awk @@ -78,7 +78,7 @@ function str2args(s, args, i, j, out, n, found) a = args[i] found = 0 for (j = 1; j <= nregs; j++) { - if (match(a, regex[j])) { + if (match(a, "^" regex[j])) { out = out value[j] found = 1 break diff --git a/as/target/x80/rules.dat b/as/target/x80/rules.dat @@ -1,37 +1,37 @@ -^imm8 AIMM8 -^imm16 AIMM16 -^imm32 AIMM32 -^imm64 AIMM64 -^imm3 AIMM3 -^rst ARST -^\(IY\+n\) AINDEX_IY -^\(IX\+n\) AINDEX_IX -^ss AREG_SSCLASS -^cc AREG_CCCLASS -^dd AREG_DDCLASS -^qq AREG_QQCLASS -^rr AREG_RRCLASS -^pp AREG_PPCLASS -^p AREG_PCLASS -^q AREG_QCLASS -^r AREG_RCLASS -^R AREG_R -^\(DE\) AINDER_DE -^\(BC\) AINDER_BC -^\(HL\) AINDER_HL -^\(SP\) AINDER_SP -^\(C\) AINDER_C -^SP AREG_SP -^HL AREG_HL -^DE AREG_DE -^IX AREG_IX -^IY AREG_IY -^AF' AREG_AF_ -^AF AREG_AF -^A AREG_A -^F AREG_F -^\(n\) ADIRECT -^I AREG_I -^0 AZERO -^sym ASYM -^string ASTR +imm8 AIMM8 +imm16 AIMM16 +imm32 AIMM32 +imm64 AIMM64 +imm3 AIMM3 +rst ARST +\(IY\+n\) AINDEX_IY +\(IX\+n\) AINDEX_IX +ss AREG_SSCLASS +cc AREG_CCCLASS +dd AREG_DDCLASS +qq AREG_QQCLASS +rr AREG_RRCLASS +pp AREG_PPCLASS +p AREG_PCLASS +q AREG_QCLASS +r AREG_RCLASS +R AREG_R +\(DE\) AINDER_DE +\(BC\) AINDER_BC +\(HL\) AINDER_HL +\(SP\) AINDER_SP +\(C\) AINDER_C +SP AREG_SP +HL AREG_HL +DE AREG_DE +IX AREG_IX +IY AREG_IY +AF' AREG_AF_ +AF AREG_AF +A AREG_A +F AREG_F +\(n\) ADIRECT +I AREG_I +0 AZERO +sym ASYM +string ASTR