mirror of
https://github.com/danbulant/Cosmos
synced 2026-06-12 11:11:45 +00:00
X#
This commit is contained in:
parent
265003885c
commit
04bc85883e
1 changed files with 32 additions and 1 deletions
|
|
@ -40,7 +40,7 @@ namespace Cosmos.Compiler.XSharp {
|
|||
for (int i = 0; i < aObj.Count; i++) {
|
||||
var xThis = this[i];
|
||||
var xThat = aObj[i];
|
||||
if (xThis.Type != aObj[i].Type) {
|
||||
if (xThis.Type != xThat.Type) {
|
||||
return false;
|
||||
} else if (xThis.Type == TokenType.AlphaNum || xThat.Type == TokenType.Keyword) {
|
||||
if (xThis.Value == null || aObj[i].Value == null) {
|
||||
|
|
@ -48,6 +48,37 @@ namespace Cosmos.Compiler.XSharp {
|
|||
return false;
|
||||
}
|
||||
} else if (xThis.Type == TokenType.Register) {
|
||||
string xThisUpper = xThis.Value.ToUpper();
|
||||
string xThatUpper = xThat.Value.ToUpper();
|
||||
|
||||
if (xThisUpper == "_REG" || xThatUpper == "_REG") {
|
||||
// true, ie continue
|
||||
|
||||
} else if (xThisUpper == "_REG8" && xThatUpper == "_REG8") {
|
||||
return false;
|
||||
} else if (xThisUpper == "_REG8" && Parser.Registers8.Contains(xThatUpper)) {
|
||||
return false;
|
||||
} else if (xThatUpper == "_REG8" && Parser.Registers8.Contains(xThisUpper)) {
|
||||
return false;
|
||||
|
||||
} else if (xThisUpper == "_REG16" && xThatUpper == "_REG16") {
|
||||
return false;
|
||||
} else if (xThisUpper == "_REG16" && Parser.Registers8.Contains(xThatUpper)) {
|
||||
return false;
|
||||
} else if (xThatUpper == "_REG16" && Parser.Registers8.Contains(xThisUpper)) {
|
||||
return false;
|
||||
|
||||
} else if (xThisUpper == "_REG32" && xThatUpper == "_REG32") {
|
||||
return false;
|
||||
} else if (xThisUpper == "_REG32" && Parser.Registers8.Contains(xThatUpper)) {
|
||||
return false;
|
||||
} else if (xThatUpper == "_REG32" && Parser.Registers8.Contains(xThisUpper)) {
|
||||
return false;
|
||||
|
||||
} else if (xThisUpper != xThatUpper) {
|
||||
// Must be last, after patterns
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue