mirror of
https://github.com/BorysLevytskyi/BitwiseCmd.git
synced 2026-02-01 08:34:41 +01:00
support of >>> operator
This commit is contained in:
@@ -83,13 +83,19 @@
|
||||
</div>
|
||||
<div class="float:left">
|
||||
<p class="section">
|
||||
<strong>Supported Bitwise Operations</strong>
|
||||
<strong>Supported Bitwise Operations</strong><br/>
|
||||
<small>
|
||||
<a href="https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Operators/Bitwise_Operators">
|
||||
as implemented in JavaScript engine
|
||||
</a>
|
||||
</small>
|
||||
<ul>
|
||||
<li><code>&</code> — bitwise AND</li>
|
||||
<li><code>|</code> — bitwise inclusive OR</li>
|
||||
<li><code>^</code> — bitwise exclusive XOR</li>
|
||||
<li><code><<</code> — left shift</li>
|
||||
<li><code>>></code> — right shift</li>
|
||||
<li><code>>></code> — sign propagating right shift</li>
|
||||
<li><code>>>></code> — zero-fill right shift</li>
|
||||
</ul>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
app.set('expression', function() {
|
||||
"use strict";
|
||||
|
||||
var exprRegex = /^(-?(?:\d+|0x[\d,a-f]+))\s*(<<|>>|\||\&|\^)\s*(-?(?:\d+|0x[\d,a-f]+))$/;
|
||||
var exprRegex = /^(-?(?:\d+|0x[\d,a-f]+))\s*(<<|>>|>>>|\||\&|\^)\s*(-?(?:\d+|0x[\d,a-f]+))$/;
|
||||
var listRegex = /^(-?(?:\d+|0x[\d,a-f]+)\s?)+$/;
|
||||
|
||||
return {
|
||||
|
||||
@@ -18,7 +18,8 @@ describe("expression parse", function() {
|
||||
"23^0x1": { operand1: 23, operand2:1, "sign":"^", string: "23^0x1" },
|
||||
"0xf>>0xa": { operand1: 15, operand2:10, "sign":">>", string:"0xf>>0xa" },
|
||||
"0x10&0x11": { operand1: 0x10, operand2:0x11, "sign":"&", string:"0x10&0x11" },
|
||||
"0x1a^11": { operand1: 0x1a, operand2:11, "sign":"^", string:"0x1a^11" }
|
||||
"0x1a^11": { operand1: 0x1a, operand2:11, "sign":"^", string:"0x1a^11" },
|
||||
"0x1a>>>11": { operand1: 0x1a, operand2:11, "sign":">>>", string:"0x1a>>>11" }
|
||||
};
|
||||
|
||||
it("should parse expressions", function() {
|
||||
|
||||
Reference in New Issue
Block a user