File tree 1 file changed +15
-3
lines changed
1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
1
package main
2
2
3
+ import " base:runtime" // args__
4
+
3
5
import " core:fmt"
4
6
import " core:math"
5
7
import " core:mem"
6
- import " core:os"
7
8
import " core:strings"
8
9
9
10
import lex " lexer"
@@ -76,13 +77,24 @@ math_max :: proc(ctx: ^run.Exec_Context, args: ^run.Fun_Args_Iterator) -> (res:
76
77
return
77
78
}
78
79
80
+ make_os_args :: proc () -> (argv: []string ) {
81
+ // See https://github.com/odin-lang/Odin/pull/4680
82
+ // And https://github.com/odin-lang/Odin/pull/4680#issuecomment-2585475395
83
+ argv = make ([]string , len (runtime.args__))
84
+ for _, i in argv do argv[i] = string (runtime.args__[i])
85
+ return
86
+ }
87
+
79
88
main :: proc () {
80
- if len (os.args) <= 1 {
89
+ os_args := make_os_args ()
90
+ defer delete (os_args)
91
+
92
+ if len (os_args) <= 1 {
81
93
fmt.println (" ERROR: No expression provided." )
82
94
return
83
95
}
84
96
85
- expr_source := strings.join (os.args [1 :], " " )
97
+ expr_source := strings.join (os_args [1 :], " " )
86
98
defer delete (expr_source)
87
99
88
100
parser: parse.Parser
You can’t perform that action at this time.
0 commit comments