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

[✅] ready for merge: starlark: add 'bytes' data type, for binary strings #115

Merged
merged 2 commits into from
May 27, 2021

Conversation

mahmoudimus
Copy link
Contributor

Description of changes in release / Impact of release:

This change defines a 'bytes' data type, an immutable string of bytes. In this Java implementation of Starlark, ordinary strings use strings of UTF-16 codes for the ordinary string type, and thus need a distinct type for byte strings.

Documentation

Risks of this release

Is this a breaking change?

  • Yes
  • No

Is there a way to disable the change?

  • Use previous release
  • Use a feature flag
  • No

Additional details go here

Attempts to fix bazelbuild/starlark#112

@mahmoudimus mahmoudimus changed the title starlark: add 'bytes' data type, for binary strings [WIP][DONOTMERGE] starlark: add 'bytes' data type, for binary strings May 16, 2021
@mahmoudimus mahmoudimus changed the base branch from master to x509-minor-cleanups May 17, 2021 18:16
@mahmoudimus mahmoudimus changed the base branch from x509-minor-cleanups to master May 17, 2021 18:17
@mahmoudimus mahmoudimus changed the base branch from master to x509-minor-cleanups May 17, 2021 20:12
Base automatically changed from x509-minor-cleanups to master May 17, 2021 20:34
@mahmoudimus mahmoudimus changed the title [WIP][DONOTMERGE] starlark: add 'bytes' data type, for binary strings [✅] ready for merge: starlark: add 'bytes' data type, for binary strings May 17, 2021
@mahmoudimus
Copy link
Contributor Author

@Agitolyev @aslepakurov I have minimized the changes to the absolute minimum to pass the specification so that we can contribute this upstream to https://github.com/bazelbuild/bazel. After reviewing this, feel free to contribute the patch upstream and to have a review from the Starlark team. You can see the relevant folks on this issue: bazelbuild/bazel#374.

- byteliteral checkin update lexer to support byteliterals and escape sequences
- lexer updated to match golang and can now parse byte prefixed strings
- introduce string escapes
- allow byte literals without using a ByteBuffer
- Fix up the comments

revert PythonBuiltins

minimize the amount of changes from upstream

more minimization of change

remove third party folder as it adds noise to patch

minimize diffs
@aslepakurov aslepakurov merged commit 5f8103c into master May 27, 2021
@aslepakurov aslepakurov deleted the byteliteral branch May 27, 2021 13:46
la-luo pushed a commit to la-luo/starlarky that referenced this pull request Sep 8, 2021
…ngs (verygoodsecurity#115)

* allow ScriptTest.java to run from libstarlark

* starlark: add 'bytes' data type, for binary strings

- byteliteral checkin update lexer to support byteliterals and escape sequences
- lexer updated to match golang and can now parse byte prefixed strings
- introduce string escapes
- allow byte literals without using a ByteBuffer
- Fix up the comments

revert PythonBuiltins

minimize the amount of changes from upstream

more minimization of change

remove third party folder as it adds noise to patch

minimize diffs
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.

spec: new 'bytes' data type
2 participants