-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Heterogeneous spread integers, top bits.
Set top bits of spread integers. Noeed to implement hetergeneous integers now for MQTT. Going to pause before implementing best-foot-forward calculations to add the spread and upper properties to the AST. See #572. See #571.
- Loading branch information
1 parent
4b961a5
commit 65d4cc5
Showing
27 changed files
with
807 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = function ({ $lookup }) { | ||
$lookup.push.apply($lookup, []) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = function ({ parsers, $lookup }) { | ||
parsers.all.object = function () { | ||
return function ($buffer, $start) { | ||
let object = { | ||
nudge: 0, | ||
value: 0, | ||
sentry: 0 | ||
} | ||
|
||
object.nudge = ($buffer[$start++]) | ||
|
||
object.value = | ||
(($buffer[$start++]) & 0x7f) * 0x80 + | ||
($buffer[$start++]) | ||
|
||
object.sentry = ($buffer[$start++]) | ||
|
||
return object | ||
} | ||
} () | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports = function ({ parsers, $lookup }) { | ||
parsers.bff.object = function () { | ||
return function () { | ||
return function ($buffer, $start, $end) { | ||
let object = { | ||
nudge: 0, | ||
value: 0, | ||
sentry: 0 | ||
} | ||
|
||
if ($end - $start < 4) { | ||
return parsers.inc.object(object, 1)($buffer, $start, $end) | ||
} | ||
|
||
object.nudge = ($buffer[$start++]) | ||
|
||
object.value = | ||
(($buffer[$start++]) & 0x7f) * 0x80 + | ||
($buffer[$start++]) | ||
|
||
object.sentry = ($buffer[$start++]) | ||
|
||
return { start: $start, object: object, parse: null } | ||
} | ||
} () | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
module.exports = function ({ parsers, $lookup }) { | ||
parsers.chk.object = function () { | ||
return function () { | ||
return function ($buffer, $start, $end) { | ||
let object = { | ||
nudge: 0, | ||
value: 0, | ||
sentry: 0 | ||
} | ||
|
||
if ($end - $start < 1) { | ||
return parsers.inc.object(object, 1)($buffer, $start, $end) | ||
} | ||
|
||
object.nudge = ($buffer[$start++]) | ||
|
||
if ($end - $start < 2) { | ||
return parsers.inc.object(object, 3)($buffer, $start, $end) | ||
} | ||
|
||
object.value = | ||
($buffer[$start++]) * 0x80 + | ||
($buffer[$start++]) | ||
|
||
if ($end - $start < 1) { | ||
return parsers.inc.object(object, 5)($buffer, $start, $end) | ||
} | ||
|
||
object.sentry = ($buffer[$start++]) | ||
|
||
return { start: $start, object: object, parse: null } | ||
} | ||
} () | ||
} | ||
} |
Oops, something went wrong.