Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit711a6e2

Browse files
Update test env
1 parent0a97191 commit711a6e2

File tree

2 files changed

+42
-28
lines changed

2 files changed

+42
-28
lines changed

‎compiler/native/env/test.js‎

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,16 @@ var TEST =
3030
stdlib:[],
3131
cli:function(compiler,preset,out,_in,option)
3232
{
33+
var_cachePath=path.join(process.cwd(),"..","cached_"+COMPILER.ENV.name+"_"+VERSION);
34+
var_precompiled=path.join(_cachePath,"nectar.o");
35+
if(!fs.existsSync(_precompiled))
36+
{
37+
console.log(`[+] Creating Nectar binary lib for${COMPILER.ENV.name+"_"+VERSION}`);
38+
try{fs.mkdirSync(_cachePath);}catch(e){};
39+
execSync(`${compiler} -std=c++17 -c nectar.cpp -Ofast -o "${_precompiled}"`);
40+
console.log("[+] Compiling with precompiled Nectar lib");
41+
}
42+
3343
if(compiler=="cl"||compiler.indexOf("cl ")==0)
3444
{
3545
if(preset=="none")return`${compiler}${_in} /std:c++17 /D CL_WINDOWS=1 /I "${CONFIG.win_inc_ucrt}" "${CONFIG.win_lib_um}\\Uuid.Lib" "${CONFIG.win_lib_um}\\kernel32.Lib" "${CONFIG.win_lib_ucrt}\\libucrt.lib" /EHsc${COMPILER.LIBS} /o${out}`;
@@ -42,13 +52,13 @@ var TEST =
4252

4353
if(preset=="none")
4454
{
45-
return`${compiler} -std=c++17 "${_in}"${option} -I${extern}/lib/ -s${COMPILER.LIBS} -o${out}${_cliOption}`;
55+
return`${compiler} -std=c++17 "${_in}""${_precompiled}"${option} -I${extern}/lib/ -s${COMPILER.LIBS} -o${out}${_cliOption}`;
4656
}
4757
elseif(preset=="size")
4858
{
49-
return`${compiler} -std=c++17 "${_in}"${option} -I${extern}/lib/ -fno-rtti -fno-stack-protector -fomit-frame-pointer -s${COMPILER.LIBS} -o${out}${_cliOption}`;
59+
return`${compiler} -std=c++17 "${_in}""${_precompiled}"${option} -I${extern}/lib/ -fno-rtti -fno-stack-protector -fomit-frame-pointer -s${COMPILER.LIBS} -o${out}${_cliOption}`;
5060
}
51-
elsereturn`${compiler} -std=c++17 "${_in}" -I${extern}/lib/${option} -s${COMPILER.LIBS} -o${out}${_cliOption}`;
61+
elsereturn`${compiler} -std=c++17 "${_in}""${_precompiled}"-I${extern}/lib/${option} -s${COMPILER.LIBS} -o${out}${_cliOption}`;
5262
},
5363
check:{
5464
"env":{
@@ -67,13 +77,25 @@ var TEST =
6777
{
6878
"undefined":false,
6979
"eval":false,
70-
"__njs_typeof":false,
71-
"module":false,
72-
"require":false,
73-
"__NJS_Log_Console":false,
74-
"__NJS_Object_Keys":false,
75-
"__NJS_ARGS":false,
76-
"__NJS_Call_Function":false,
80+
"__njs_typeof":false,
81+
"console":false,
82+
"module":false,
83+
"require":false,
84+
"__Nectar_Log_Console":false,
85+
"__Nectar_InitVar":false,
86+
"__Nectar_Object_Keys":false,
87+
"__Nectar_Object_Stringify":false,
88+
"__Nectar_Call_Function":false,
89+
"__NJS_ARGS":false,
90+
"__NJS_ENV":false,
91+
"__NJS_PLATFORM":false,
92+
"__Nectar_typeof":false,
93+
"__Nectar_THIS":false,
94+
"__Nectar_instanceof":false,
95+
"JSON":false,
96+
"Object":false,
97+
"isNaN":false,
98+
"Array":false,
7799
"$ERROR":false,
78100
}
79101
}

‎compiler/native/squel/test.cpp‎

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,20 @@
2020
*
2121
*/
2222
#define_USE_MATH_DEFINES
23-
#include<cmath>
24-
#include<string>
25-
#include<iostream>
26-
#include<string>
27-
#include<cstring>
28-
#include<stdio.h>
29-
#include<stdlib.h>
30-
#include<string.h>
31-
#include<sstream>
32-
#include<vector>
33-
#include<memory>
3423

35-
#include"njs.h"
36-
usingnamespaceNJS::Global;
24+
#include"nectar.hpp"
25+
usingnamespaceNectarCore::Global;
26+
usingnamespaceNectarCore::Functions;
3727

3828
var __NJS_ENV ="test";
3929
var __NJS_PLATFORM ="{{__PLATFORM__}}";
4030

4131
/*** $ERROR ***/
42-
NJS::VAR __NJS_DOLLAR_ERROR =__NJS_Create_Var_Unscoped_Anon( __NJS_Log_Console(__NJS_VARARGS[0]); exit(1);returnNJS::VAR(); );
32+
NectarCore::VAR __NJS_DOLLAR_ERROR =__Nectar_Create_Var_Unscoped_Anon( __Nectar_Log_Console(__Nectar_VARARGS[0]); exit(1);returnNectarCore::VAR(); );
4333
/* end $ERROR*/
44-
34+
#define__NJS_Create_Object()new NectarCore::Class::Object()
35+
#define__NJS_Create_Array(_arr)new NectarCore::Class::Array(_arr)
36+
#define__NJS_InitVar() NectarCore::VAR()
4537
{INCLUDE}
4638

4739
{DECL}
@@ -51,7 +43,7 @@ int main(int argc, char* argv[])
5143
var __NJS_ARGS =__NJS_Create_Array();
5244
for(int i =0; i < argc; i++)
5345
{
54-
__NJS_Object_Set(i,NJS::VAR(argv[i]), __NJS_ARGS);
46+
__NJS_ARGS[i] =NectarCore::VAR(argv[i]);
5547
}
5648

5749
try
@@ -61,9 +53,9 @@ int main(int argc, char* argv[])
6153
{CODE}
6254
}
6355
}
64-
catch(NJS::VAR __NJS_Global_Exception)
56+
catch(NectarCore::VAR __NJS_Global_Exception)
6557
{
66-
__NJS_Log_Console(__NJS_Global_Exception);
58+
__Nectar_Log_Console(__NJS_Global_Exception);
6759
exit(1);
6860
}
6961
return0;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp