Skip to content

Commit

Permalink
support |= &= ^= >>= <<=
Browse files Browse the repository at this point in the history
  • Loading branch information
pikasTech committed Dec 26, 2023
1 parent bbe04c7 commit a4c85cc
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
2 changes: 1 addition & 1 deletion port/linux/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// "--gtest_filter=vm.run_file"
// "--gtest_filter=stddata.encode_decode"
// "--gtest_filter=packtool.packfiles_txt"
"--gtest_filter=fuzzypid.fuzzypid1"
"--gtest_filter=parser.rshift_equ"
],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
Expand Down
17 changes: 15 additions & 2 deletions src/PikaParser.c
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,19 @@ char* Lexer_getTokenStream(Args* outBuffs, char* sStmt) {
*/
if (('>' == c0) || ('<' == c0) || ('*' == c0) || ('/' == c0)) {
if (c0 == c1) {
/* >>=, <<=, **=, //= */
if ('=' == c2) {
char sContent[4] = {0};
sContent[0] = c0;
sContent[1] = c1;
sContent[2] = '=';
aTokenStream = Lexer_setSymbel(aTokenStream, sStmt, i,
&iSymbolStartIndex);
aTokenStream = Lexer_setToken(aTokenStream,
TOKEN_operator, sContent);
i = i + 2;
continue;
}
char content[3] = {0};
content[0] = c0;
content[1] = c1;
Expand All @@ -624,11 +637,11 @@ char* Lexer_getTokenStream(Args* outBuffs, char* sStmt) {
}
}
/*
>=, <=, *=, /=, +=, -=, !=, ==, %=
>=, <=, *=, /=, +=, -=, !=, ==, %=, |=, ^=, &=
*/
if (('>' == c0) || ('<' == c0) || ('*' == c0) || ('/' == c0) ||
('+' == c0) || ('-' == c0) || ('!' == c0) || ('=' == c0) ||
('%' == c0) || ('^' == c0)) {
('%' == c0) || ('|' == c0) || ('&' == c0) || ('^' == c0)) {
if ('=' == c1) {
char content[3] = {0};
content[0] = c0;
Expand Down
2 changes: 1 addition & 1 deletion src/PikaVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
#define PIKA_VERSION_MINOR 13
#define PIKA_VERSION_MICRO 1

#define PIKA_EDIT_TIME "2023/12/18 02:17:06"
#define PIKA_EDIT_TIME "2023/12/26 10:36:08"

0 comments on commit a4c85cc

Please sign in to comment.