Commit a2a30008 authored by Yuri Chornoivan's avatar Yuri Chornoivan
Browse files

Fix minor typos

parent d1aa9b67
Pipeline #20173 failed with stage
in 3 minutes and 38 seconds
......@@ -9,7 +9,7 @@ The goal of KTurtle is to make programming as easy and accessible as possible. T
Some of the main features of KTurtle include:
* the ability to translate the programming commands into the native language of the student using the KDE translation framework.
* all you need integrated in in one application.
* all you need integrated in one application.
* simplified programming terminology.
* intuitive syntax highlighting and error markers.
......
......@@ -54,7 +54,7 @@ describe "mathmatical operators" do
EOS
end
it "should produce error when deviding by zero" do
it "should produce error when dividing by zero" do
$i.run('$x = 1 / 0').errors?.should be_true
end
......@@ -113,7 +113,7 @@ describe "mathmatical operators" do
EOS
end
it "should work as expected with trigoniometical functions" do
it "should work as expected with trigonometrical functions" do
$i.should_run_clean <<-EOS
assert (sin -90) == -1
assert (sin 0) == 0
......@@ -170,4 +170,4 @@ describe "mathmatical operators" do
it "should work for floating point numbers"
it "should allow mixing of natural and floating point numbers"
end
\ No newline at end of file
end
......@@ -83,7 +83,7 @@ describe "repeat loop" do
end
it "should not execute the scope when argument is empty" do
# TODO decide: do we really want this? or do we like the current behaivior in which unassigned
# TODO decide: do we really want this? or do we like the current behavior in which unassigned
$i.should_run_clean <<-EOS
repeat $x {
assert false
......@@ -120,4 +120,4 @@ describe "repeat loop" do
it "should produce an error when scope is omitted" do
$i.run('repeat 3').errors?.should be_true
end
end
\ No newline at end of file
end
......@@ -21,11 +21,11 @@ $i = Interpreter.instance
describe "scopes" do
it "should allow empty scopes" do
true.should_not be_true
# empty scopes currenty hang the interpreter
# empty scopes currently hang the interpreter
# so do scopes without a flow/learn statement
# TODO fix this. (without the fix the other tests are useless)
end
it "should error on unbalanced scopes"
it "should properly localize variables"
end
\ No newline at end of file
end
......@@ -217,26 +217,26 @@ bool Editor::saveFile(const QUrl &targetUrl)
Tokenizer tokenizer;
tokenizer.initialize(editor->document()->toPlainText());
const QStringList localizedLooks(Translator::instance()->allLocalizedLooks());
QString unstranslated;
QString untranslated;
Token* t;
bool pendingEOL = false; // to avoid writing a final EOL token
while ((t = tokenizer.getToken())->type() != Token::EndOfInput) {
if (pendingEOL) {
unstranslated.append('\n');
untranslated.append('\n');
pendingEOL = false;
}
if (localizedLooks.contains(t->look())) {
QString defaultLook(Translator::instance()->defaultLook(t->look()));
unstranslated.append(QStringLiteral("@(%1)").arg(defaultLook));
untranslated.append(QStringLiteral("@(%1)").arg(defaultLook));
} else {
if (t->type() == Token::EndOfLine)
pendingEOL = true;
else
unstranslated.append(t->look());
untranslated.append(t->look());
}
}
outputStream << KTURTLE_MAGIC_1_0 << '\n';
outputStream << unstranslated;
outputStream << untranslated;
outputStream.flush();
if (savefile->commit()) {
result = true;
......
......@@ -15,8 +15,8 @@
# Boston, MA 02110-1301, USA.
# In this file commands/instuctions/keywords/symbols/etc can easily be added to kturtle.
# Changes can also be made here, but be carefull cauz the existing code may rely on stuff in here.
# In this file commands/instructions/keywords/symbols/etc can easily be added to kturtle.
# Changes can also be made here, but be careful cause the existing code may rely on stuff in here.
# Thanks for looking at the code...
......@@ -38,8 +38,8 @@
# @help, .docbook formatted text for in a help file
# In the @funct variable, one or more catagories of the item can be put.
# These are the catagories and their descriptions:
# In the @funct variable, one or more categories of the item can be put.
# These are the categories and their descriptions:
#
# statement the item is a statement and thus will be parsed as such
# constant the item is a constant so does not need any execution
......@@ -474,7 +474,7 @@ new_item()
// We hit a break command while executing the scope
breaking = false; // Not breaking anymore
currentVariableTable()->remove(id); // remove the value (cleanup)
return; // Move to the next sibbling
return; // Move to the next sibling
}
if (currentVariableTable()->contains(id)) {
......@@ -551,7 +551,7 @@ new_item()
// so we do: exec scope, exec expressions, exec scope, exec expressions, ...
//TODO: We have the cleanup part twice (after breaking and after the last iteration
// perhaps clean it up by putting in in one place?
// perhaps clean it up by putting it in one place?
bool firstIteration = false;
if (functionStack.isEmpty() || functionStack.top().function != node) {
......@@ -849,7 +849,7 @@ EOS
parse_item()
new_item()
@type = "Substracton"
@type = "Subtraction"
@cat = "MathOperator"
@look = "-"
@localize = false
......
......@@ -198,7 +198,7 @@ void Executer::execute(TreeNode* node)
case Token::GreaterOrEquals : executeGreaterOrEquals(node); break;
case Token::LessOrEquals : executeLessOrEquals(node); break;
case Token::Addition : executeAddition(node); break;
case Token::Substracton : executeSubstracton(node); break;
case Token::Subtraction : executeSubtraction(node); break;
case Token::Multiplication : executeMultiplication(node); break;
case Token::Division : executeDivision(node); break;
case Token::Power : executePower(node); break;
......@@ -246,7 +246,7 @@ void Executer::execute(TreeNode* node)
//END GENERATED executer_switch_cpp CODE
default:
//qDebug() << "Unrecognizd Token type (" << node->token()->type() << ", " << node->token()->look() << ") -- THIS SHOULDN'T HAPPEN!";
//qDebug() << "Unrecognized Token type (" << node->token()->type() << ", " << node->token()->look() << ") -- THIS SHOULDN'T HAPPEN!";
break;
}
......@@ -513,7 +513,7 @@ void Executer::executeWhile(TreeNode* node) {
// We hit a break command while executing the scope
breaking = false; // Not breaking anymore
currentVariableTable()->remove(id); // remove the value (cleanup)
return; // Move to the next sibbling
return; // Move to the next sibling
}
if (currentVariableTable()->contains(id)) {
......@@ -540,7 +540,7 @@ void Executer::executeForTo(TreeNode* node) {
// so we do: exec scope, exec expressions, exec scope, exec expressions, ...
//TODO: We have the cleanup part twice (after breaking and after the last iteration
// perhaps clean it up by putting in in one place?
// perhaps clean it up by putting it in one place?
bool firstIteration = false;
if (functionStack.isEmpty() || functionStack.top().function != node) {
......@@ -727,7 +727,7 @@ void Executer::executeAddition(TreeNode* node) {
node->value()->setString(node->child(0)->value()->string().append(node->child(1)->value()->string()));
}
}
void Executer::executeSubstracton(TreeNode* node) {
void Executer::executeSubtraction(TreeNode* node) {
// //qDebug() << "called";
if(node->childCount()!=2) {
addError(i18n("You need two numbers to subtract"), *node->token(), 0);
......
......@@ -206,7 +206,7 @@ class Executer : public QObject
void executeGreaterOrEquals(TreeNode* node);
void executeLessOrEquals(TreeNode* node);
void executeAddition(TreeNode* node);
void executeSubstracton(TreeNode* node);
void executeSubtraction(TreeNode* node);
void executeMultiplication(TreeNode* node);
void executeDivision(TreeNode* node);
void executePower(TreeNode* node);
......
......@@ -368,7 +368,7 @@ TreeNode* Parser::parseSignedFactor()
return parseFactor();
break;
case Token::Substracton:
case Token::Subtraction:
rememberedToken = currentToken;
nextToken();
node = parseFactor();
......@@ -440,7 +440,7 @@ TreeNode* Parser::parseExpression()
Token* prevToken = nullptr;
while ((currentToken->type() == Token::Addition) ||
(currentToken->type() == Token::Substracton) ||
(currentToken->type() == Token::Subtraction) ||
(currentToken->type() == Token::GreaterThan) ||
(currentToken->type() == Token::GreaterOrEquals) ||
(currentToken->type() == Token::LessThan) ||
......
......@@ -160,7 +160,7 @@ int Token::typeToCategory(int type)
return ArgumentSeparatorCategory;
case Power:
case Substracton:
case Subtraction:
case Multiplication:
case Division:
case Addition:
......
......@@ -105,7 +105,7 @@ class Token
GreaterOrEquals,
LessOrEquals,
Addition,
Substracton,
Subtraction,
Multiplication,
Division,
Power,
......
......@@ -130,7 +130,7 @@ Token* Tokenizer::getToken()
return new Token(Token::Number, look, startRow, startCol, row, col);
}
// catch previously uncatched 'double charactered tokens' (tokens that ar not in letters, like: == != >= <=)
// catch previously uncaught 'double character tokens' (tokens that ar not in letters, like: == != >= <=)
{
QString look = QString(c).append(getChar());
int type = translator->look2type(look);
......
......@@ -262,7 +262,7 @@ void Translator::setDictionary()
look2typeMap[QStringLiteral("+")] = Token::Addition;
look2typeMap[QStringLiteral("-")] = Token::Substracton;
look2typeMap[QStringLiteral("-")] = Token::Subtraction;
look2typeMap[QStringLiteral("*")] = Token::Multiplication;
......
......@@ -67,7 +67,7 @@ class TreeNode
/** @returns the pointer to associated Token. @see setToken() */
Token* token() { return _token; }
/** @returns the pointer to assiciated Value. @see setValue() @see setNullValue() */
/** @returns the pointer to associated Value. @see setValue() @see setNullValue() */
Value* value() { if (_value == 0) _value = new Value(); return _value; }
......
......@@ -149,7 +149,7 @@ int main(int argc, char* argv[])
if (!inputFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
std::cout << "Could not open input file: " << qPrintable(parser.value("test")) << std::endl;
std::cout << "Exitting..." << std::endl;
std::cout << "Exiting..." << std::endl;
return 1;
}
......@@ -168,7 +168,7 @@ int main(int argc, char* argv[])
std::cout << "Set localization to: " << parser.value(QStringLiteral("lang")).data() << std::endl;
} else {
std::cout << "Could not set localization to:" << parser.value(QStringLiteral("lang")).data() << std::endl;
std::cout << "Exitting...\n";
std::cout << "Exiting...\n";
return 1;
}
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment