code fixes
fix negative signs disable debug info add requirement in zadanie.txt
This commit is contained in:
parent
1edb0fa0ec
commit
2a83456d27
4 changed files with 10 additions and 11 deletions
2
.vscode/tasks.json
vendored
2
.vscode/tasks.json
vendored
|
@ -12,7 +12,7 @@
|
|||
"${workspaceFolder}\\build\\build.exe"
|
||||
],
|
||||
"options": {
|
||||
"cwd": "${fileDirname}"
|
||||
"cwd": "${workspaceFolder}\\build\\"
|
||||
},
|
||||
"problemMatcher": [
|
||||
"$gcc"
|
||||
|
|
|
@ -145,12 +145,11 @@ void correctNegativeSign(parseResult* _input) {
|
|||
for (auto it = parsed->begin(); it != parsed->end(); it++) {
|
||||
auto jt = it + 1; //next element
|
||||
if (it->type == SymbolType::subract && jt != parsed->end() && jt->type == SymbolType::number) {
|
||||
it = parsed->erase(it);
|
||||
it->value = it->value * (-1);
|
||||
it->type = SymbolType::add;
|
||||
jt->value = jt->value * (-1);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
parsed->shrink_to_fit();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -162,6 +161,8 @@ void correctNegativeSign(parseResult* _input) {
|
|||
*/
|
||||
bool validateParsation(const std::vector<Symbol>* _input) {
|
||||
return true;
|
||||
|
||||
// FIXME: It's broken somewhere
|
||||
if (_input->size() == 0) return false;
|
||||
for (auto it = _input->begin(); true /* Break argument 2 lines down */; it++) {
|
||||
auto jt = it + 1;
|
||||
|
@ -311,11 +312,8 @@ Symbol calculateUsingStack(std::vector<Symbol>& _stack) {
|
|||
return toPut;
|
||||
} break;
|
||||
case SymbolType::subract: {
|
||||
Stack::take<Symbol>(_stack); //top symbol...
|
||||
Symbol toPut;
|
||||
toPut.value = calculateUsingStack(_stack).value - calculateUsingStack(_stack).value;
|
||||
Stack::put<Symbol>(_stack, toPut);
|
||||
return toPut;
|
||||
//subtract is unnecessary because it's already converted to addition in previous step.
|
||||
throw "impossible";
|
||||
} break;
|
||||
case SymbolType::multiply: {
|
||||
Stack::take<Symbol>(_stack); //top symbol...
|
||||
|
|
|
@ -139,7 +139,7 @@ int main() {
|
|||
terminal::key_right(keys);
|
||||
break;
|
||||
default:
|
||||
debugKey(input, debugOffset);
|
||||
// debugKey(input, debugOffset);
|
||||
break;
|
||||
}
|
||||
continue;
|
||||
|
@ -176,7 +176,7 @@ int main() {
|
|||
exit |= commands::loop();
|
||||
break;
|
||||
default:
|
||||
debugKey(input, debugOffset);
|
||||
// debugKey(input, debugOffset);
|
||||
break;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@ Poziom dokumentacji: 3 stopniowa (wymagania, instrukcja z zrzutami ekranu, kod p
|
|||
Format instrukcji: A4
|
||||
Format zapisu instrukcji: PDF
|
||||
Format pliku do upload'u: ZIP (bez hasła)
|
||||
Nazwa pliku zip: R1IS_Prog.CPP_projekt_<nazwisko><imie>.zip
|
||||
Czcionka kodu programu: KONSOLOWA
|
||||
Wymagana wersja źródłowa kodu: TAK
|
||||
Wymagana wersja wykonywalna kodu: TAK
|
||||
|
|
Reference in a new issue