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

Use octal values for output of tag code values. #137

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ZaneHannanAU
Copy link

Simpler reading of emitted source for values under 8 (and simpler reading of emitted type values regardless).

Mostly a readability thing for outputted code.

Simpler reading of emitted source for values under 8 (and simpler reading of emitted type values regardless).
@tafia
Copy link
Owner

tafia commented May 21, 2019

Hey, sorry for the late answer. May I know why do you think octal is better than hex for instance?
I don't really mind but to me it doesn't really improves anything. It could be even better not to show any tag value at all because it is of very little information for general consumers.

@ZaneHannanAU
Copy link
Author

In this case, it's because it displays somewhat better. For instance, rather than

message L {
  uint32 k = 1;
}

producing a (slightly nonsensical) Ok(8) value, it produces a (more readable) Ok(0o10) value.

This expands to others, but does peter out after field 7 (0o70--0o75), where it becomes 0o100 for field 8; so obviously, this isn't perfect. It generates the same binary regardless (as in, it becomes collapsed) but it offers some insight for what types map to.

Other than that, literally no reason. Simply stronger patterns for humans to recognise.

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.

2 participants