-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove atoms table #5
Conversation
WalkthroughThe recent changes overhaul the atom representation in the Prolog interpreter by converting the Changes
Assessment against linked issues
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ @@ Coverage Diff @@
## main #5 +/- ##
==========================================
+ Coverage 98.20% 98.33% +0.13%
==========================================
Files 23 23
Lines 6515 6503 -12
==========================================
- Hits 6398 6395 -3
+ Misses 88 79 -9
Partials 29 29
|
7e1b6c5
to
598d3e7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (7)
- engine/atom.go (4 hunks)
- engine/builtin.go (7 hunks)
- engine/compound.go (3 hunks)
- engine/parser.go (5 hunks)
- engine/stream.go (2 hunks)
- engine/term_test.go (1 hunks)
- engine/vm_test.go (1 hunks)
Additional comments not posted (23)
engine/term_test.go (2)
51-51
: LGTM! Ensure test cases reflect the new atom representation.The change from
Atom(0)
toAtom("")
aligns with the shift to string-based atom representation.
57-57
: LGTM! Ensure test cases reflect the new atom representation.The change from
Atom(0).Apply(Integer(0))
toAtom("").Apply(Integer(0))
aligns with the shift to string-based atom representation.engine/vm_test.go (1)
290-310
: Great addition! Enhances test coverage for VM functionality.The new test function
TestVM_ResetEnv
ensures that the environment reset behaves as intended.engine/stream.go (2)
362-362
: LGTM! Ensure method reflects the new atom representation.The change from checking
s.alias
as an integer to a string aligns with the shift to string-based atom representation.
513-513
: LGTM! Ensure method reflects the new atom representation.The change from checking
s.alias
as an integer to a string aligns with the shift to string-based atom representation.engine/atom.go (3)
199-199
: LGTM! Simplified atom representation.The change from
uint64
tostring
for theAtom
type simplifies the representation and aligns with the PR objectives.
203-204
: LGTM! Simplified atom creation.The
NewAtom
function now directly returns anAtom
created from the input string, removing unnecessary complexity.
206-207
: LGTM! New function for creating atoms from runes.The
NewAtomRune
function allows for the creation of anAtom
from arune
, maintaining character representation.engine/compound.go (3)
207-207
: LGTM! Updated condition to reflect string representation.The condition checking
opts.left.name
has been updated to compare against an empty string""
, aligning with the new string-based representation ofAtom
.
497-497
: LGTM! Updated atom instantiation.The instantiation of
Atom
has been updated fromAtom(0)
toAtom("")
, aligning with the new string-based representation.
527-527
: LGTM! Improved character representation.The assignment of
t
has been updated to useNewAtomRune(r)
, ensuring correct handling of character representation.engine/parser.go (5)
466-466
: LGTM! Updated return type for error handling.The
op
function now returns an empty string""
instead of0
for error cases, aligning with the new string-based representation ofAtom
.
472-472
: LGTM! Consistent error handling.The error handling logic in the
op
function now returns an empty string""
instead of0
, ensuring consistency in the return type.
480-480
: LGTM! Consistent default return type.The default case in the
op
function now returns an empty string""
instead of0
, aligning with the new string-based representation ofAtom
.
574-574
: LGTM! Updated placeholder comparison.The placeholder comparison in the
term0Atom
function has been updated top.placeholder != ""
, reflecting the new string-based representation ofAtom
.
619-619
: LGTM! Updated return type for error handling.The
atom
function now returns an empty string""
instead of0
for error cases, aligning with the new string-based representation ofAtom
.engine/builtin.go (7)
1624-1624
: LGTM!The change to use
NewAtomRune(r)
improves consistency in character handling.
1688-1689
: LGTM!The changes improve character validation and decoding, enhancing error handling.
1863-1863
: LGTM!The change to use
NewAtomRune(r)
improves consistency in character handling.
1943-1943
: LGTM!The change to use
NewAtomRune(r)
improves consistency in character handling.
2586-2586
: LGTM!The changes to use
NewAtomRune(r)
improve consistency in character handling.Also applies to: 2601-2601
2337-2337
: LGTM!The change to use
NewAtomRune(r)
improves consistency in character handling.
Line range hint
1-2604
: LGTM!The
appendUniqNewAtom
function correctly appends unique atoms to a slice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, and it's simpler! Thanks :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay 👍
Implement and fixe axone-protocol/axoned#699.
I take opportunity to add test for
ResetEnv()
method of VM from the previous PR.