Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
BaseMax committed Mar 5, 2025
1 parent 8fa72d0 commit e92991a
Show file tree
Hide file tree
Showing 6 changed files with 210 additions and 321 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
src/test
# TS
salam-wa.js
salam.min.js
Expand Down
16 changes: 11 additions & 5 deletions src/phase/lexer/lex/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,17 @@ export function lexerLexString(lexer: Lexer, opening: string): void {

if (lexer.currentChar === '\\') {
lexer.advance();
// if (lexer.currentChar === '"' || lexer.currentChar === "'" || lexer.currentChar === '\\') {
// value += lexer.currentChar;
// } else {
// value += '\\';
// }
switch (lexer.currentChar) {
case 'n': value += '\\n'; break;
case 't': value += '\\t'; break;
case 'r': value += '\\r'; break;
case '\\': value += '\\\\'; break;
case '"': value += '\\"'; break;
case "'": value += "'"; break;
case '`': value += '`'; break;
default:
value += '\\' + lexer.currentChar;
}
} else {
value += lexer.currentChar;
}
Expand Down
Binary file added src/test
Binary file not shown.
60 changes: 32 additions & 28 deletions src/test.c
Original file line number Diff line number Diff line change
@@ -1,28 +1,32 @@
<!doctype html>
<html dir="ltr" lang="en-US">
<head>
<title>Salam Untitled</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.a {color:white;background-color:black;margin-top:20;padding-top:20px}
.a:hover {background-color:white}
.a:focus {background-color:green}
@media screen and (min-width: 400px) {.a:hover {background-color:pink}}
@media screen and (min-width: 400px) {.a:focus {background-color:pink}}
@media screen and (min-width: 400px) {.a {background-color:pink}}
</style>
</head>
<body>
<input class=a>
<input class=a>
<input class=a>
<input class=a>
<input class=a>
<input class=a>
<input class=a>
<input class=a>
<input class=a>
<input class=a>
</body>
</html>
// Libraries
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <math.h>
#include <time.h>
#include <ctype.h>

// Sign functions
char* _int2str(int a);
char* test();
char* main();

// Functions
char* _int2str(int a) {
return ("110");
}

char* test() {
char* a = (char*) malloc(strlen("Hey ") + 1);
if (a == NULL) {
printf("Memory allocation failed in a\n");
exit(1);
}
strcpy(a, "Hey ");
return (a);
}

char* main() {
printf("%s", "\n");
}
Loading

0 comments on commit e92991a

Please # to comment.