Skip to content

Commit fc513ad

Browse files
committed
Bug fixed
1 parent 4232ffd commit fc513ad

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

YukimiScript.CodeGen/Bytecode.fs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,17 @@ let generateBytecode (Intermediate scenes) (target: FileStream) =
7171
|> writeBytes code
7272

7373
for arg in call.Arguments do
74-
let typeid, data =
75-
match arg with
76-
| Integer i -> 0u, getBytesLE i
77-
| Real f -> 1u, getBytesLE (float32 f)
78-
| String s -> 2u, getString s |> getBytesLE
79-
| Symbol s -> 3u, getString s |> getBytesLE
80-
81-
writeBytes code (getBytesLE typeid)
82-
writeBytes code data
74+
match arg with
75+
| Integer i ->
76+
writeBytes code <| getBytesLE 0
77+
writeBytes code <| getBytesLE i
78+
| Real f ->
79+
writeBytes code <| getBytesLE 1
80+
writeBytes code <| getBytesLE (float32 f)
81+
| String s ->
82+
getString s |> int |> (+) 2 |> getBytesLE |> writeBytes code
83+
| Symbol s ->
84+
getString s |> int |> (*) (-1) |> (-) 1 |> getBytesLE |> writeBytes code
8385

8486
code
8587

0 commit comments

Comments
 (0)