Skip to content
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

Support octal literals #151

Merged
merged 3 commits into from
Sep 15, 2024
Merged

Conversation

fennecJ
Copy link
Collaborator

@fennecJ fennecJ commented Sep 14, 2024

As title, this PR basically implement support for octal literals in numeric constants and function parameters.

@fennecJ fennecJ force-pushed the Supporting_octal_literals branch from 9f6e642 to e3c6388 Compare September 14, 2024 10:31
@jserv jserv changed the title Supporting octal literals Support octal literals Sep 14, 2024
@jserv jserv requested a review from ChAoSUnItY September 14, 2024 12:36
Copy link
Collaborator

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read https://cbea.ms/git-commit/ carefully and refine the commits.

@jserv jserv requested a review from vacantron September 14, 2024 12:37
@jserv
Copy link
Collaborator

jserv commented Sep 14, 2024

You should extend the test suite for octal literals.

@fennecJ
Copy link
Collaborator Author

fennecJ commented Sep 14, 2024

I just added some test cases for octal literals, but I found that the current testing method has significant limitations. It seems like it can only test values where the final result is between 0 and 255 (a byte) . Additionally, testing for negative numbers requires handling through printf. Should we consider improving our testing process to handle a broader range of cases more efficiently? What are your thoughts on this?

@fennecJ fennecJ force-pushed the Supporting_octal_literals branch 2 times, most recently from 730f416 to d694188 Compare September 14, 2024 17:12
@jserv
Copy link
Collaborator

jserv commented Sep 15, 2024

I just added some test cases for octal literals, but I found that the current testing method has significant limitations. It seems like it can only test values where the final result is between 0 and 255 (a byte) . Additionally, testing for negative numbers requires handling through printf. Should we consider improving our testing process to handle a broader range of cases more efficiently? What are your thoughts on this?

You can create a new issue to track the improvements of the test suite.

Copy link
Collaborator

@jserv jserv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid using backticks in git commit messages and comments to ensure compatibility with terminal emulators that may not render the backtick character properly.

Instead, use the pair ' or " (quotation marks).

Add extra logic to deal with octal literals satisfied re(0[0-7]+)
in function 'read_numeric_param'.
Add extra logic to deal with octal literals satisfied re(0[0-7]+) in
function 'read_numeric_constant'.
- Added test cases for octal literals in constant declarations.
- Ensured correct behavior for arithmetic operations with octal values.
- Tested bitwise operations involving octal numbers.
- Added variable declaration tests using octal literals.
- Ensured proper handling of octal literals passed as function params.
@jserv jserv merged commit 2c852d0 into sysprog21:master Sep 15, 2024
4 checks passed
@jserv
Copy link
Collaborator

jserv commented Sep 15, 2024

Thank @fennecJ for contributing!

@fennecJ fennecJ deleted the Supporting_octal_literals branch September 22, 2024 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants