Skip to content

Commit f1f1ed7

Browse files
Updated Main
1 parent 62d83d9 commit f1f1ed7

6 files changed

Lines changed: 88 additions & 12 deletions

File tree

HTTP/http.ezcode

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ class http {
66
return runexec http.dll.Http.HTTP.GET ~> {url}
77
}
88
method POST : @str:url, @str:data, @str:contentType => @str {
9-
return runexec http.dll.Http.HTTP.GET ~> {url}, {data}, {contentType}
9+
return runexec http.dll.Http.HTTP.POST ~> {url}, {data}, {contentType}
1010
}
1111
}

Main/Main.ezcode

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,45 @@ class str {
244244
return runexec EZCodeLanguage.EZHelp.EndsWith ~> {text}, {val}
245245
}
246246
}
247+
class char {
248+
explicit typeof => EZCodeLanguage.EZCode.DataType("char")
249+
explicit watch \^{CHAR} => set : CHAR
250+
explicit params => set : PARAMS
251+
undefined Value
252+
get => @str {
253+
return str parse : Value
254+
}
255+
get => @bool {
256+
return bool parse : Value
257+
}
258+
method set : ch {
259+
= ch
260+
}
261+
nocol method = : @char:ch => @char {
262+
Value => ch
263+
}
264+
method parse : val => @char {
265+
return runexec EZCodeLanguage.EZHelp.StringParse ~> {val}
266+
}
267+
method length {
268+
return stringlength : Value
269+
}
270+
method stringlength : val {
271+
return runexec EZCodeLanguage.EZHelp.StringLength ~> {val}
272+
}
273+
nocol method != : val => @bool {
274+
return runexec EZCodeLanguage.EZHelp.Compare ~> {Value}, !=, {val}
275+
}
276+
nocol method == : val => @bool {
277+
return runexec EZCodeLanguage.EZHelp.Compare ~> {Value}, =, {val}
278+
}
279+
method lower : @char:val => @char {
280+
return runexec EZCodeLanguage.EZHelp.ToLower ~> {val}
281+
}
282+
method upper : @char:val => @char {
283+
return runexec EZCodeLanguage.EZHelp.ToUpper ~> {val}
284+
}
285+
}
247286
class var {
248287
explicit params => set : PARAMS
249288
undefined Value
@@ -288,6 +327,18 @@ class var {
288327
get => @str {
289328
return Value
290329
}
330+
get => @char {
331+
undefined returns
332+
int length new => str stringlength : Value
333+
if length != 1 {
334+
char c new : Value
335+
returns => c
336+
}
337+
else {
338+
throw Can not return type char from var value: Value
339+
}
340+
return returns
341+
}
291342
get => @bool {
292343
return runexec EZCodeLanguage.EZHelp.ObjectParse ~> {Value}, bool
293344
}
@@ -382,4 +433,7 @@ global method istype : __val, __type => @bool {
382433
}
383434
global method regexmatch : @str:__val, @str:__match => @bool {
384435
return runexec EZCodeLanguage.EZHelp.RegexMatch ~> {__val}, {__match}
436+
}
437+
global method exit {
438+
runexec EZCodeLanguage.EZHelp.Exit
385439
}

Main/environment.ezcode

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
global method environment : @str:property, ? val1, val2 {
2+
return runexec EZCodeLanguage.EZHelp.EnvironmentOS ~> {property}, {val1}, {val2}
3+
}
4+
class envvariable {
5+
method setval : @str:name, @str:value {
6+
environment setenvironmentvariable, name, value
7+
}
8+
method getval : @str:name {
9+
return environment getenvironmentvariable, name
10+
}
11+
}

Main/math.ezcode

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
1-
nocol method add : obj1, obj2 => @float {
1+
global nocol method add : obj1, obj2 => @float {
22
return runexec EZCodeLanguage.EZHelp.Add ~> {obj1}, {obj2}
33
}
4-
nocol method subtract : obj1, obj2 => @float {
4+
global nocol method subtract : obj1, obj2 => @float {
55
return runexec EZCodeLanguage.EZHelp.Subtract ~> {obj1}, {obj2}
66
}
7-
nocol method multiply : obj1, obj2 => @float {
7+
global nocol method multiply : obj1, obj2 => @float {
88
return runexec EZCodeLanguage.EZHelp.Multiply ~> {obj1}, {obj2}
99
}
10-
nocol method divide : obj1, obj2 => @float {
10+
global nocol method divide : obj1, obj2 => @float {
1111
return runexec EZCodeLanguage.EZHelp.Divide ~> {obj1}, {obj2}
1212
}
13-
nocol method avg : ! @float:nums => @float {
13+
global nocol method avg : ! @float:nums => @float {
1414
return runexec EZCodeLanguage.EZHelp.Average ~> {nums}
1515
}
16-
nocol method clamp : @float:val, @float:min, @float:max => @float {
16+
global nocol method clamp : @float:val, @float:min, @float:max => @float {
1717
return runexec EZCodeLanguage.EZHelp.Clamp ~> {val}, {min}, {max}
1818
}
19-
method pi => @float {
19+
global nocol method random : @float:min, @float:max => @float {
20+
return runexec EZCodeLanguage.EZHelp.RandomNumber ~> {min}, {max}
21+
}
22+
global method pi => @float {
2023
return runexec EZCodeLanguage.EZHelp.Pi
2124
}
22-
method logbase-e => @float {
25+
global method logbase-e => @float {
2326
return runexec EZCodeLanguage.EZHelp.E
2427
}
25-
nocol method operate : @str:op, ! @float:obj => @float {
28+
global nocol method operate : @str:op, ! @float:obj => @float {
2629
return runexec EZCodeLanguage.EZHelp.MathFunc ~> {obj}, {op}
2730
}

Main/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
{
22
"Name":"main",
33
"Files": [
4-
"Main.ezcode",
4+
"main.ezcode",
55
"lists.ezcode",
6-
"math.ezcode"
6+
"math.ezcode",
7+
"time.ezcode",
8+
"environment.ezcode"
79
],
810
"Configuration":{
911

Main/time.ezcode

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class time {
2+
3+
}
4+
class timer {
5+
6+
}

0 commit comments

Comments
 (0)