Skip to content

Commit 0e34f26

Browse files
committed
eeee
1 parent a95d073 commit 0e34f26

File tree

3 files changed

+81
-2
lines changed

3 files changed

+81
-2
lines changed

source/backend/Mods.hx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ class Mods
2727
'weeks',
2828
'fonts',
2929
'scripts',
30-
'achievements'
30+
'achievements',
31+
'chartModifiers'
3132
];
3233

3334
private static var globalMods:Array<String> = [];

source/yutautil/ExtendedDate.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ class ExtendedDate extends FlxBasic {
246246
case Either.Left(date):
247247
date.month == todayMonth && date.day == todayDay;
248248
case Either.Right(date):
249-
(Type.enumIndex(date.month)+1) == todayMonth && date.day == todayDay;
249+
(Type.enumIndex(date.month)) == todayMonth && date.day == todayDay;
250250
}
251251
}
252252

source/yutautil/YScript.hx

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
package yutautil;
2+
3+
import haxe.ds.StringMap;
4+
5+
class YScript {
6+
private var keywords:Map<String, String>;
7+
8+
public function new() {
9+
keywords = new StringMap<String>();
10+
keywords.set("class", "class");
11+
keywords.set("var", "var");
12+
keywords.set("struct", "struct");
13+
keywords.set("function", "function");
14+
keywords.set("use", "use");
15+
keywords.set("if", "if");
16+
keywords.set("while", "while");
17+
keywords.set("for", "for");
18+
}
19+
20+
public function parse(script:String):Void {
21+
var lines = script.split("\n");
22+
for (line in lines) {
23+
line = line.trim();
24+
if (line == "" || line.startsWith("//")) continue; // Skip empty lines and comments
25+
26+
try {
27+
parseLine(line);
28+
} catch (e:Dynamic) {
29+
trace("Error parsing line: " + line + "\n" + e);
30+
}
31+
}
32+
}
33+
34+
private function parseLine(line:String):Void {
35+
if (line.indexOf(";") == -1) throw "Missing semicolon at the end of the line.";
36+
37+
var tokens = line.split(" ");
38+
var keyword = tokens[0];
39+
40+
if (!keywords.exists(keyword)) throw "Unknown keyword: " + keyword;
41+
42+
switch (keyword) {
43+
case "class":
44+
parseClass(line);
45+
case "var":
46+
parseVariable(line);
47+
case "struct":
48+
parseStruct(line);
49+
case "function":
50+
parseFunction(line);
51+
case "use":
52+
parseUse(line);
53+
default:
54+
throw "Unhandled keyword: " + keyword;
55+
}
56+
}
57+
58+
private function parseClass(line:String):Void {
59+
// Implement class parsing logic
60+
}
61+
62+
private function parseVariable(line:String):Void {
63+
// Implement variable parsing logic
64+
}
65+
66+
private function parseStruct(line:String):Void {
67+
// Implement struct parsing logic
68+
}
69+
70+
private function parseFunction(line:String):Void {
71+
// Implement function parsing logic
72+
}
73+
74+
private function parseUse(line:String):Void {
75+
// Implement use parsing logic
76+
}
77+
}
78+

0 commit comments

Comments
 (0)