Skip to content

Commit 23f5c26

Browse files
v1.2-alpha
added L# molds and L# childs: ``` def mold foo(...): end ``` called: `foo(...)` ``` def child foo(any a, ...): end ``` called: `var.foo()`
1 parent 678e964 commit 23f5c26

12 files changed

Lines changed: 3035 additions & 2572 deletions

Error.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
#include "Error.h"
2-
3-
const std::string Error::errorTypeWarn = "\x1B[35m";
4-
const std::string Error::errorTypeError = "\x1B[31m";
5-
const std::string Error::errorTypeInfo = "\x1B[33m";
6-
const std::string Error::errorTypeValid = "\x1b[32m";
7-
const std::string Error::errorTypeNormal = "\x1B[37m";
8-
const int Error::typeWarn = 0;
9-
std::map<int, bool> Error::enabledWarns = {
10-
{ typeWarn, true }
11-
};
12-
13-
void warn(int typewarn, int line, std::stringstream message) {
14-
if (Error::enabledWarns[typewarn]) {
15-
std::cout << Error::errorTypeWarn << "Warning at line " << Error::errorTypeNormal << line << " " << message.str() << std::endl;
16-
}
1+
#include "Error.h"
2+
3+
const std::string Error::errorTypeWarn = "\x1B[35m";
4+
const std::string Error::errorTypeError = "\x1B[31m";
5+
const std::string Error::errorTypeInfo = "\x1B[33m";
6+
const std::string Error::errorTypeValid = "\x1b[32m";
7+
const std::string Error::errorTypeNormal = "\x1B[37m";
8+
const int Error::typeWarn = 0;
9+
std::map<int, bool> Error::enabledWarns = {
10+
{ typeWarn, true }
11+
};
12+
13+
void warn(int typewarn, int line, std::stringstream message) {
14+
if (Error::enabledWarns[typewarn]) {
15+
std::cout << Error::errorTypeWarn << "Warning at line " << Error::errorTypeNormal << line << " " << message.str() << std::endl;
16+
}
1717
}

Error.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
#pragma once
2-
#include <string>
3-
#include <iostream>
4-
#include <sstream>
5-
#include <map>
6-
7-
namespace Error
8-
{
9-
extern const std::string errorTypeWarn;
10-
extern const std::string errorTypeError;
11-
extern const std::string errorTypeInfo;
12-
extern const std::string errorTypeValid;
13-
extern const std::string errorTypeNormal;
14-
extern const int typeWarn;
15-
16-
extern std::map<int, bool> enabledWarns;
17-
}
18-
1+
#pragma once
2+
#include <string>
3+
#include <iostream>
4+
#include <sstream>
5+
#include <map>
6+
7+
namespace Error
8+
{
9+
extern const std::string errorTypeWarn;
10+
extern const std::string errorTypeError;
11+
extern const std::string errorTypeInfo;
12+
extern const std::string errorTypeValid;
13+
extern const std::string errorTypeNormal;
14+
extern const int typeWarn;
15+
16+
extern std::map<int, bool> enabledWarns;
17+
}
18+
1919
void warn(int warnType, int line, std::stringstream message);

0 commit comments

Comments
 (0)