Skip to content

Commit 91b0a7f

Browse files
committed
Merge pull request #38 from elite-lang/dev
v0.9.0
2 parents edeb618 + dbc2cc8 commit 91b0a7f

File tree

20 files changed

+46
-2246
lines changed

20 files changed

+46
-2246
lines changed

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,10 @@ install:
99
- sudo sh ./scripts/fix_ubuntu_llvm.sh
1010
- sudo sh ./scripts/install_gtest.sh
1111
- sudo sh ./scripts/chmod_runnable.sh
12-
- pip install --user codecov
1312

1413
script:
1514
- make test
1615
- python ./EliteTest/full_test/run_test.py
1716

1817
after_success:
19-
- codecov
20-
18+
- bash <(curl -s https://codecov.io/bash)

Builder/src/Worker.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Worker* Worker::CreateDefault(const char* lex_cfg,
5656
p->setScriptRunner(s);
5757

5858
// 向脚本引擎中注入更多接口
59-
c->Init(NULL);
59+
c->Init();
6060
s->setCodeGenContext(c->getContext());
6161

6262
// 向脚本引擎中注入各对象

CHANGELOG.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,34 @@
11
Change Log
22
===============
33

4+
### v0.9.0
5+
6+
添加了GC系统
7+
修复了自定义malloc函数时的类型转换异常
8+
使用PassManager管理多遍语法树扫描
9+
删除了无用的包和函数
10+
11+
------------------------
12+
### v0.8.5
13+
14+
全面支持了更好的调试信息输出
15+
添加对编译器内部过程可视化的支持
16+
更加优雅的打印list表达式
17+
18+
------------------------
419
### v0.8.4
520

621
修复了部分插件系统的bug
722
完成了graphviz图的绘制
823

9-
24+
------------------------
1025
### v0.8.3
1126

1227
大幅修缮了插件系统,修复JIT的bug
1328
新增ICodeGenContext接口
1429
修复了BasicBlock的相关bug
1530

16-
31+
------------------------
1732
### v0.8.2
1833

1934
2016纪念版
@@ -22,6 +37,8 @@ Change Log
2237
添加了扩展包管理器的链接属性支持
2338
添加bdwgc库
2439

40+
41+
------------------------
2542
### v0.8.1 2015-12-26
2643

2744
增加了delete指令

ExIconv/test/EstringTest.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* @Author: sxf
33
* @Date: 2015-12-16 12:02:18
44
* @Last Modified by: sxf
5-
* @Last Modified time: 2015-12-24 22:32:10
5+
* @Last Modified time: 2016-03-05 17:01:18
66
*/
77

88
#include <gtest/gtest.h>
@@ -70,4 +70,13 @@ __ESTRING_TEST__(Enter)
7070
printf("%s\n",substr.to_utf8().c_str());
7171
estring ans = "这里稍稍有点问题so, I";
7272
EXPECT_EQ(substr==ans, true);
73+
}
74+
75+
76+
__ESTRING_TEST__(Construction2AndFind)
77+
{
78+
estring str("hello您好, 这是一段中英混排");
79+
estring estr(str.ec_str());
80+
EXPECT_EQ(str==estr, true);
81+
EXPECT_EQ(str.find('l'), 2);
7382
}

packages/bgc/bgc.epbc

1.88 KB
Binary file not shown.

packages/bgc/bgc.epbc.ll

Lines changed: 0 additions & 2031 deletions
This file was deleted.

packages/bgc/libbgc.a

-55.5 KB
Binary file not shown.

packages/bgc/src/bgc.o

-55.5 KB
Binary file not shown.

packages/bgc/src/main.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,16 @@
99
#include "ICodeGenContext.h"
1010
#include "CodeGenContext.h"
1111
#include "Model/nodes.h"
12-
12+
#include "Pass.h"
13+
#include "PassManager.h"
1314

1415
using namespace std;
1516

1617

1718
extern "C" {
1819

1920
static LValue new_macro(CodeGenContext* context, Node* node) {
20-
printf("Happy New Year!\n");
21+
printf("Happy New Year! ~ From Bcg Package\n");
2122
TypeNode* tn = (TypeNode*) node;
2223
LValue t = context->FindSrcType(tn->getTypeName());
2324

@@ -40,14 +41,19 @@ static LValue new_macro(CodeGenContext* context, Node* node) {
4041
}
4142

4243
static const FuncReg macro_funcs[] = {
43-
{"new_bgc", new_macro},
44+
{"new", new_macro},
4445
{0, 0}
4546
};
4647

4748
extern void bgc_elite_plugin_init(ICodeGenContext* context) {
4849
printf("Bgc plugin loaded.\n");
4950
if (context == NULL) printf("Error for context\n");
50-
else context->AddOrReplaceMacros(macro_funcs);
51+
else {
52+
auto pm = context->getPassManager();
53+
auto main_list = pm->getPassList("main");
54+
Pass* pass = *(main_list->begin());
55+
pass->AddOrReplaceMacros(macro_funcs);
56+
}
5157
}
5258

5359
}

0 commit comments

Comments
 (0)