BUG修复:PaxScript没有异或运算的bug

本文介绍如何解决PAXScript中异或(^)运算符未被支持的问题,并提供具体的代码修改建议。同时,文中还提到PAXScript不支持省略new关键字创建数组的情况。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

paxScript 居然不支持异或(^)运算? 

 

 

 

 
其实paxScript已经实现 Parse_BitwiseXORExpression 函数 。只不过作者可能忘了 处理 ^ 符号。

 

解决方法如下:
 
修改PAX_JAVASCRIPT.pas,把有//ked注释的行 增加上去:

共有3出增加:

 

1:

  SP_AND_ASSIGN = -1021;
  SP_XOR_ASSIGN = -1022;    //ked 2009年10月21日
 

2:

          (CurrToken.ID = SP_OR_ASSIGN) or
          (CurrToken.ID = SP_XOR_ASSIGN) or  //ked 2009年10月21日

 

3: 

      SP_OR_ASSIGN: OP := OP_OR;
      SP_XOR_ASSIGN: OP := OP_XOR;    //ked 2009年10月21日
 

 

另外
 
paxscript 不支持省略new
 
var a = Array();在ie里面不会报错,但paxscript里会出现非法操作。
 
写成下面的就不会有问题了:
 
 
 
 var a =new Array();

paxscriptnet2.7(价值187美金)C#代码解释执行器 About paxScript.NET 18 December 2013. Support of MS Visual Studio 2013. The Microsoft NET version of the paxScript scripting engine (paxScript.NET) includes interpreters of C# and VB.NET languages. The key features of paxScript.NET are: paxScript.NET is written in C#. Source code of paxScript.NET is CLS compilant. Support of Silverlight and Windows Phone platforms of Microsoft .NET Framework. Support of Mono. paxScript.NET compiles programs into byte-code. It does not use CodeDOM and it does not generate a dynamic assembly. Separate compilation of modules is allowed. You can combine source code modules and compiled (binary) modules in your paxScript.NET script project. Cross-language scripting is allowed. You can combine modules written in C# and VB.NET in your paxScript.NET script project. C# interpreter is based on the ECMA-334 standard. It supports all C# language features with exception for the unsafe code, attributes and generic types. The interpreter extends standard of C# language with extra features which simplify the use of C# for scripting needs (more...). paxScript.NET is implemented as a .NET component ( paxscript-net.dll) which can be used with Microsoft Visual Studio .NET and Mono. The component allows you to embed paxScript.NET interpreter into your WinForms, Mobile or ASP.NET application so you can customize and extend the application without having to recompile it. Any classes, structures, enumerations, arrays, delegates, events and interfaces of host application can be used in a script. (See demo...). You call script-defined methods from host application. (See demo...). Debug capabilities: breakpoints, call stack, watch/evaluate, trace into, step over etc. (See demo...).
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值