Skip to content

Commit 0ba18ea

Browse files
committed
SIFOSC、初期化スクリプトの実行。
1 parent 8526a08 commit 0ba18ea

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

FastChatProtocolInterface/SimpleFormulaScript/SifoscObject.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
using System;
99
using System.Collections.Concurrent;
1010
using System.Collections.Generic;
11-
using System.Net.Http.Headers;
1211
using System.Threading;
1312

1413
namespace FastChatProtocolInterface.SimpleFormulaScript

FastChatProtocolInterface/SimpleFormulaScript/SifoscServer.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@
66
****/
77

88
using System;
9+
using System.Diagnostics;
910
using System.Net;
1011

1112
namespace FastChatProtocolInterface.SimpleFormulaScript
1213
{
1314
public class SifoscServer(IPAddress ipAddr, int port) : FachpiServer(ipAddr, port)
1415
{
16+
static SifoscServer()
17+
{
18+
bool succeeded = new SourceCode("[null,allobj,true,false]").TryParse(out _);
19+
20+
Debug.Assert(succeeded);
21+
}
22+
1523
public override void OnConnected()
1624
{
1725
base.OnConnected();
@@ -26,7 +34,7 @@ protected override string ReceiveMessageCore(FachpiCommunicationFlow flow)
2634

2735
public static string RunScriptLine(string s)
2836
{
29-
// SIFOSC の例:[ [ null, allobj, true, false, newobj, 123 ], [ null, newobj, 123, +456, -789, [ ] ], [ 1, 2, 3 ] + [ 2 + 2, 5, 2 * 3 ] + [ 1 + 2 * 3 ], +-+-+-+100, ([([([])])]), 1 + ((1 + 2) * 3 + 1) / 2 % 3 - 4, [ true | false & true ^ false, (true | false) & (true ^ false) & false, !(((3 & 5) + (3 | 5) + (3 ^ 5)) - (3 & 5 + 3 | 5 + 3 ^ 5)), !!true, !!0, !!123, !!!false ] ];
37+
// SIFOSC の例:[ [ null, allobj, true, false, newobj, 123 ], [ null, newobj, 123, +456, -789, [ ] ], [ 1, 2, 3 ] + [ 2 + 2, 5, 2 * 3 ] + [ 1 + 2 * 3 ], +-+-+-+100, ([([([])])]), 1 + ((1 + 2) * 3 + 1) / 2 % 3 - 4, [ true | false & true ^ false, (true | false) & (true ^ false) & false, !(((3 & 5) + (3 | 5) + (3 ^ 5)) - (3 & 5 + 3 | 5 + 3 ^ 5)), !!true, !!0, !!123, !!!false ], [ allobj.0, allobj.1.1.3 ].1 ];
3038

3139
var sc = new SourceCode(s);
3240
if (sc.TryParse(out var result)) {

0 commit comments

Comments
 (0)