Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Insoft-UK committed Feb 17, 2025
1 parent 5353cd4 commit b3adce6
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 21 deletions.
Binary file modified installer/package-root/Applications/HP/PrimeSDK/bin/p+
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#ifndef DICTIONARY_PPLIB
#define DICTIONARY_PPLIB

#define Event key, type[1], x[2]; y[3], dx[4]; dy[5]
#define Event key, type[1], x[2], y[3], dx[4], dy[5]
#define TouchEvent fngr1.x[1,1], fngr1.y[1,2], fngr1.originalX[1,3], fngr1.originalY[1,4], fngr1.mouseType[1,5], fngr1[1], fngr2.x[2,1], fngr2.y[2,2], fngr2.originalX[2,3], fngr2.originalY[2,4], fngr2.mouseType[2,5], fngr1[2]
#define Point x[1], y[2]
#define Size width[1], height[2]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,15 @@
#define var LOCAL
#define pi π
#define FROM :=
#define emptylist {0}

@global regex `\b([a-zA-Z_]\w*) *([*\/+-])\= *` $1 := $1 $2


@global regex `\bfor ([^;]+);([^;]+); *([^;]+)do` $1; WHILE $2 DO__PUSH__`__INDENT__$3;`
@global regex `\b(next|end)\b` __POP__END
@global regex `\bloop\b` WHILE 1 DO
@global regex `\bswitch +([a-zA-Z_]\w*)` LOCAL sw__SCOPE__ := $1;CASE
@global regex `\bswitch +([a-zA-Z_][\w.:(),]*)` LOCAL sw__SCOPE__ := $1;CASE
@global regex `\bcase +(\-?\d+) +do *$` IF sw\`__SCOPE__-1` == $1 THEN
@global regex `\(([^?]+)\?(.+):(.+)\)` IFTE($1, $2, $3)
@global regex `\.{3}|…` TO
Expand Down
Binary file modified installer/primeplus.pkg
Binary file not shown.
6 changes: 4 additions & 2 deletions p+.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@

/* Begin PBXFileSystemSynchronizedRootGroup section */
13CD08322D60E5900005D2EA /* pplib */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); name = pplib; path = "installer/package-root/Applications/HP/PrimeSDK/pplib"; sourceTree = "<group>"; };
13CD08542D629DB20005D2EA /* Projects */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {Colors/src/main.pp = sourcecode.c; }; explicitFolders = (); name = Projects; path = "../PrimeSDK/installer/package-root/Users/Shared/Projects"; sourceTree = SOURCE_ROOT; };
13CDCDDF2D499BE30005D2EA /* python */ = {isa = PBXFileSystemSynchronizedRootGroup; explicitFileTypes = {}; explicitFolders = (); path = python; sourceTree = "<group>"; };
/* End PBXFileSystemSynchronizedRootGroup section */

Expand All @@ -96,6 +97,7 @@
1351CC552BFC0E180073FEDF /* README.md */,
136E64472D2877660054E0CC /* version.txt */,
137FB2942A046E8E00AEFDF2 /* p+.entitlements */,
13CD08542D629DB20005D2EA /* Projects */,
13CDCDDF2D499BE30005D2EA /* python */,
13CD08322D60E5900005D2EA /* pplib */,
13166E852BA12E5E00D1E6F0 /* examples */,
Expand Down Expand Up @@ -221,7 +223,7 @@
1352EC5D2B40B72B003130E4 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
alwaysOutOfDate = 1;
buildActionMask = 12;
buildActionMask = 8;
files = (
);
inputFileListPaths = (
Expand All @@ -232,7 +234,7 @@
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
runOnlyForDeploymentPostprocessing = 1;
shellPath = /bin/sh;
shellScript = "./version_code\nmv version_code.h src/version_code.h\n";
};
Expand Down
2 changes: 1 addition & 1 deletion src/dictionary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ bool Dictionary::proccessDictionary(const std::string &str) {
identity.type = Aliases::Type::Def;


re = R"(^(@global )?dict(?:ionary)? +(.+) ((?:`[\w.:]+`)|[\w.:]+)(?:\(([A-Za-z_ ,]+)\))?;$)";
re = R"(^(@global )?dict +(.+) ((?:`[\w.:]+`)|[\w.:]+)(?:\(([A-Za-z_ ,]+)\))?;$)";
if (regex_search(s1, match, re)) {
identity.scope = match[1].matched ? Aliases::Scope::Global : Aliases::Scope::Auto;

Expand Down
22 changes: 12 additions & 10 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ void translatePPlusLine(std::string &ln, std::ofstream &outfile) {
std::smatch match;
std::ifstream infile;

// static std::vector<std::string> stack;


Singleton *singleton = Singleton::shared();

static int consecutiveBlankLines = 0;
Expand All @@ -247,14 +246,7 @@ void translatePPlusLine(std::string &ln, std::ofstream &outfile) {
}

if (singleton->regexp.parse(ln)) return;
singleton->regexp.resolveAllRegularExpression(ln);


/*
A code stack provides a convenient way to store code snippets
that can be retrieved and used later.
*/
singleton->codeStack.parse(ln);


/*
Expand All @@ -280,7 +272,16 @@ void translatePPlusLine(std::string &ln, std::ofstream &outfile) {


ln = singleton->aliases.resolveAllAliasesInText(ln);
capitalizeKeywords(ln);


singleton->regexp.resolveAllRegularExpression(ln);


/*
A code stack provides a convenient way to store code snippets
that can be retrieved and used later.
*/
singleton->codeStack.parse(ln);

if (Def::isDefine(ln)) {
Def::processDefine(ln);
Expand All @@ -294,6 +295,7 @@ void translatePPlusLine(std::string &ln, std::ofstream &outfile) {
return;
}

capitalizeKeywords(ln);
ln = removeWhitespaceAroundOperators(ln);

/*
Expand Down
10 changes: 5 additions & 5 deletions src/version_code.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

#define VERSION_NUMBER "3.1.2"
#define VERSION_CODE "C1C57-25BE"
#define NUMERIC_BUILD 31257
#define INTERNAL_BUILD_CODE "C1C57"
#define DATE "2025 February 15"
#define VERSION_NUMBER "3.1.3"
#define VERSION_CODE "C1D17-25BG"
#define NUMERIC_BUILD 31317
#define INTERNAL_BUILD_CODE "C1D17"
#define DATE "2025 February 17"
#define YEAR "2025"
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
31257
31317

0 comments on commit b3adce6

Please sign in to comment.