Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
v1.2.1+1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
HZZcode authored Oct 14, 2024
1 parent 46dedfd commit a29f81e
Show file tree
Hide file tree
Showing 6 changed files with 283 additions and 31 deletions.
52 changes: 26 additions & 26 deletions CMakeLists.txt.user
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 14.0.1, 2024-09-28T22:29:41. -->
<!-- Written by QtCreator 14.0.1, 2024-10-14T10:21:14. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
Expand Down Expand Up @@ -109,14 +109,14 @@
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_BUILD_TYPE:STRING=Debug
-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_BUILD_TYPE:STRING=Debug</value>
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\14354\Documents\Qt Projects\MicrologicIDE\build\Desktop_Qt_6_7_2_MinGW_64_bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
Expand Down Expand Up @@ -166,14 +166,14 @@
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_BUILD_TYPE:STRING=Release
-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_BUILD_TYPE:STRING=Release</value>
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\14354\Documents\Qt Projects\MicrologicIDE\build\Desktop_Qt_6_7_2_MinGW_64_bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
Expand Down Expand Up @@ -222,14 +222,14 @@
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\14354\Documents\Qt Projects\MicrologicIDE\build\Desktop_Qt_6_7_2_MinGW_64_bit-RelWithDebInfo</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
Expand Down Expand Up @@ -276,14 +276,14 @@
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo
-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo</value>
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\14354\Documents\Qt Projects\MicrologicIDE\build\Desktop_Qt_6_7_2_MinGW_64_bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
Expand Down Expand Up @@ -331,14 +331,14 @@
<value type="int" key="CMake.Configure.BaseEnvironment">2</value>
<value type="bool" key="CMake.Configure.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="CMake.Configure.UserEnvironmentChanges"/>
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
<value type="QString" key="CMake.Initial.Parameters">-DCMAKE_BUILD_TYPE:STRING=MinSizeRel
-DCMAKE_GENERATOR:STRING=Ninja
-DCMAKE_CXX_COMPILER:FILEPATH=%{Compiler:Executable:Cxx}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}
-DQT_QMAKE_EXECUTABLE:FILEPATH=%{Qt:qmakeExecutable}
-DCMAKE_BUILD_TYPE:STRING=MinSizeRel</value>
-DCMAKE_PROJECT_INCLUDE_BEFORE:FILEPATH=%{BuildConfig:BuildDirectory:NativeFilePath}/.qtc/package-manager/auto-setup.cmake
-DCMAKE_CXX_FLAGS_INIT:STRING=%{Qt:QML_DEBUG_FLAG}
-DCMAKE_C_COMPILER:FILEPATH=%{Compiler:Executable:C}
-DCMAKE_PREFIX_PATH:PATH=%{Qt:QT_INSTALL_PREFIX}</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\14354\Documents\Qt Projects\MicrologicIDE\build\Desktop_Qt_6_7_2_MinGW_64_bit-MinSizeRel</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
Expand Down
Binary file modified Micrologic.exe
Binary file not shown.
35 changes: 32 additions & 3 deletions MicrologicIDE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ std::vector<bool> MicrologicIDE::grammarCheck(std::vector<std::string> lines){
if(atoi(args[1].c_str())<Ls.size()) ans[i]=true;
else ans[i]=false;
}
else ans[i]=false;
}
else if((args[0]=="input:"||args[0]=="output:")&&args.size()==2){
if(isNumber(args[1])){
Expand All @@ -543,6 +544,7 @@ std::vector<bool> MicrologicIDE::grammarCheck(std::vector<std::string> lines){
}
else ans[i]=false;
}
else ans[i]=false;
}
else if(args[0]=="input"&&args.size()==3){
if(isNumber(args[1])&&isNumber(args[2])){
Expand All @@ -566,6 +568,7 @@ std::vector<bool> MicrologicIDE::grammarCheck(std::vector<std::string> lines){
if(atoi(args[1].c_str())<outs.size()) ans[i]=true;
else ans[i]=false;
}
else ans[i]=false;
}
else if((args[0]=="tick"||args[0]=="tick!")&&args.size()==1){
ans[i]=true;
Expand All @@ -579,16 +582,19 @@ std::vector<bool> MicrologicIDE::grammarCheck(std::vector<std::string> lines){
else if(args[0]=="path"&&args.size()==2){
ans[i]=true;
}
else if(args[0]=="open"&&args.size()==2){
else if((args[0]=="open"||args[0]=="safe-open")&&args.size()==2){
ans[i]=true;
}
else if(args[0]=="open"&&count(line.begin(),line.end(),'\"')>=2){
else if((args[0]=="open"||args[0]=="safe-open")&&count(line.begin(),line.end(),'\"')>=2){
ans[i]=true;
}
else if(args[0]=="mod"&&args.size()==3){
modBlock.insert({args[1],0});
ans[i]=true;
}
else if(args[0]=="check-mod"&&args.size()==1){
ans[i]=true;
}
else if(args[0]=="block"&&args.size()>=3){
if(mods.count(args[1])!=0){
if(args.size()==2+mods[args[1]].first+mods[args[1]].second) ans[i]=true;
Expand All @@ -597,6 +603,17 @@ std::vector<bool> MicrologicIDE::grammarCheck(std::vector<std::string> lines){
}
else ans[i]=false;
}
else if(args[0]=="block-type"&&args.size()==2){
if(isNumber(args[1])){
int blockCount=0;
for(const std::pair<std::string,int>& p:modBlock){
if(p.first!="N"&&p.first!="A"&&p.first!="R"&&p.first!="T"&&p.first!="C"&&p.first!="P") blockCount+=p.second;
}
if(atoi(args[1].c_str())<blockCount) ans[i]=true;
else ans[i]=false;
}
else ans[i]=false;
}
else if((args[0]=="type"||args[0]=="tag")&&args.size()==2){
if(isNumber(args[1])){
if(atoi(args[1].c_str())<Ls.size()) ans[i]=true;
Expand All @@ -613,6 +630,7 @@ std::vector<bool> MicrologicIDE::grammarCheck(std::vector<std::string> lines){
else if(args[0]=="check-output"&&atoi(args[1].c_str())<outs.size()) ans[i]=true;
else ans[i]=false;
}
else ans[i]=false;
}
else if(args[0]=="inspect"&&args.size()==3){
if(mods.count(args[1])!=0||args[1]=="N"||args[1]=="A"||args[1]=="R"||args[1]=="T"||args[1]=="C"||args[1]=="P"){
Expand All @@ -621,6 +639,17 @@ std::vector<bool> MicrologicIDE::grammarCheck(std::vector<std::string> lines){
}
else ans[i]=false;
}
else if(args[0]=="del"&&args.size()==3){
if(args[1]=="line"){
if(isNumber(args[2])&&atoi(args[2].c_str())<Ls.size()) ans[i]=true;
else ans[i]=false;
}
else if(mods.count(args[1])!=0||args[1]=="N"||args[1]=="A"||args[1]=="R"||args[1]=="T"||args[1]=="C"||args[1]=="P"){
if(isNumber(args[2])&&atoi(args[2].c_str())<modBlock[args[1]]) ans[i]=true;
else ans[i]=false;
}
else ans[i]=false;
}
else if(args[0]=="echo"){
ans[i]=true;
}
Expand All @@ -632,7 +661,7 @@ std::vector<bool> MicrologicIDE::grammarCheck(std::vector<std::string> lines){
else ans[i]=false;
}
else if(args[0]=="lang"&&args.size()==2){
ans[i]=std::count(langs.begin(),langs.end(),args[1])==1;
ans[i]=std::count(langs.begin(),langs.end(),args[1])>0;
}
else if(args[0]=="neko"&&args.size()==1){
ans[i]=true;
Expand Down
4 changes: 2 additions & 2 deletions MicrologicIDE.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class MicrologicIDE : public QMainWindow
std::string debugInfo{};

std::vector<std::string> blankChars;
const std::vector<std::string> keys={"end","line","wline","N","A","R","T","C","P","set","check","input:","input","output:","output","tick","tick!","speed","path","open","mod","block","inspect","echo","@echo","clear","help","clear"};
const std::vector<std::string> keys={"end","line","wline","N","A","R","T","C","P","set","check","input:","input","output:","output","tick","tick!","speed","path","open","safe-open","mod","check-mods","block","block-type","tag","type","check-input","check-output","inspect","del","export","echo","@echo","clear","help","lang"};
const std::vector<std::string> nums={"0","1","2","3","4","5","6","7","8","9"};

explicit MicrologicIDE(QWidget *parent = 0);
Expand Down Expand Up @@ -98,7 +98,7 @@ class MicrologicIDE : public QMainWindow
return l;
}

std::vector<std::string> langs={"list","zh_cn","en_us"};
std::vector<std::string> langs={"list"};

private slots:

Expand Down
7 changes: 7 additions & 0 deletions help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,24 @@ tick [TIMES] Tick mutiple times.
tick! Tick once, and output values of all lines after it.
tick! [TIMES] Tick mutiple times, and output values of all lines after every tick.
speed [SPEED] Set speed. The default speed is 1.
path Check current path.
path [PATH] Set path of scripts. Use double quotation marks when the path name include spaces.
open [FILE] Open an Micrologic script file. Use double quotation marks when the file name include spaces.
safe-open [FILE] Similar to open, but disable some commands.
mod [MOD] [FILE] Give an file a mod name, in order to use it as a block afterwards.
check-mods Check all current mods.
block [MOD] [INPUT [INPUT ...]] [OUTPUT [OUTPUT ...]] Creates a user-defined block.
block-type [BLOCK] Check the type of a designated block.
tag [ALINE] Check whether a line is set as input or output.
type [ALINE] Check whether a line is wide.
check-input Lists the line order numbers of input lines.
check-input [INPUT] Lists the line order number of a designated input line.
check-output Lists the line order numbers of output lines.
check-output [OUTPUT] Lists the line order number of a designated output line.
inspect [BLOCKTYPE] [BLOCK] Checks whether a block connects correct line type.
del [BLOCKTYPE] [BLOCK] Delete a designated block.
del line [ALINE] Delete a designated line. No bugs were found in tn test but you'd betterbe careful of those blocks without line connection.
export Export current blocks.
echo [MESSAGE] Outputs a message.
@echo [ECHO] Set whether to echo messages. Requires 0 or 1.
clear Clear the interpreter' data and restart.
Expand Down
Loading

0 comments on commit a29f81e

Please sign in to comment.