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

[DMS-47] Support text type #27

Merged
merged 1 commit into from
Jun 17, 2024
Merged

[DMS-47] Support text type #27

merged 1 commit into from
Jun 17, 2024

Conversation

DK318
Copy link
Member

@DK318 DK318 commented Jun 11, 2024

This PR adds support for text in motoko-san. This is done by adding a field for each string literal and mapping them to field access.

Example

let x = "some_string";

Translation

...
field $text: Int // was generated for "some_string"
...
define $Perm($Self) (true && .. && acc($Self.$text, write)) // string literal could be accessed in any scope of the program
...
var x: Int;
x := $Self.$text;

test/viper/unsupported.mo Show resolved Hide resolved
src/viper/trans.ml Outdated Show resolved Hide resolved
test/viper/ok/text.vpr.ok Outdated Show resolved Hide resolved
src/viper/trans.ml Outdated Show resolved Hide resolved
Copy link

@GoPavel GoPavel left a comment

Choose a reason for hiding this comment

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

LGTM except small nitpicks

src/viper/trans.ml Outdated Show resolved Hide resolved
src/viper/trans.ml Outdated Show resolved Hide resolved
src/viper/trans.ml Outdated Show resolved Hide resolved
test/viper/unsupported.mo Show resolved Hide resolved
@DK318 DK318 force-pushed the motoko-san/support-text-type branch from f0991d0 to 6694c85 Compare June 17, 2024 13:00
@DK318 DK318 merged commit eb81c2b into master Jun 17, 2024
1 of 4 checks passed
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