Skip to content

Commit dbdc56f

Browse files
committed
Константа std::OwnLang с версией и платформой
1 parent 9540834 commit dbdc56f

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/main/java/com/annimon/ownlang/Main.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,13 @@
2121
* @author aNNiMON
2222
*/
2323
public final class Main {
24-
25-
public static final String VERSION = "1.3.1_" + Gen.BUILD_DATE;
24+
25+
public static int VERSION_MAJOR = 1;
26+
public static int VERSION_MINOR = 4;
27+
public static int VERSION_PATCH = 0;
28+
public static final String VERSION = VERSION_MAJOR + "."
29+
+ VERSION_MINOR + "." + VERSION_PATCH
30+
+ "_" + Gen.BUILD_DATE;
2631

2732
private static String[] ownlangArgs = new String[0];
2833

src/main/java/com/annimon/ownlang/modules/std/std.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,13 @@
1111
public final class std implements Module {
1212

1313
public static void initConstants() {
14+
MapValue ownlang = new MapValue(5);
15+
ownlang.set("PLATFORM", new StringValue("desktop"));
16+
ownlang.set("VERSION", new StringValue(Main.VERSION));
17+
ownlang.set("VERSION_MAJOR", NumberValue.of(Main.VERSION_MAJOR));
18+
ownlang.set("VERSION_MINOR", NumberValue.of(Main.VERSION_MINOR));
19+
ownlang.set("VERSION_PATCH", NumberValue.of(Main.VERSION_PATCH));
20+
Variables.define("OwnLang", ownlang);
1421
}
1522

1623
@Override

0 commit comments

Comments
 (0)