-
Notifications
You must be signed in to change notification settings - Fork 163
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
Spec: document string literals #108
Conversation
Copied from google/starlark-go#265 I omitted the implementation notes.
Note that it doesn't exactly match the Java implementation, e.g. we reject \a. |
def" # "abcdef" | ||
``` | ||
|
||
An *octal escape* encodes a single byte using its octal value. |
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.
(The reference to byte here isn't really appropriate for the Java implementation.)
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.
The rest of the spec mentions that a "string represents an immutable sequence of bytes."
I think it's correct that an octal escape encodes a byte.
Do you have another phrasing to suggest?
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.
This seems fine for now. Correctly documenting how the Java implementation differs is a complex and subtle project.
spec.md
Outdated
'\119' # "\t9" = "\11" + "9" | ||
``` | ||
|
||
A *hex escape* encodes a single byte using its hexadecimal value. |
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.
(and hex escapes aren't implemented in Java)
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.
Removing
Yes, useless though it may be, every language supports \a thus so should we. |
Copied from google/starlark-go#265
I omitted the implementation notes.