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

(FunC) Add description of multiline strings #704

Open
novusnota opened this issue Aug 2, 2024 · 0 comments
Open

(FunC) Add description of multiline strings #704

novusnota opened this issue Aug 2, 2024 · 0 comments

Comments

@novusnota
Copy link
Contributor

novusnota commented Aug 2, 2024

Is your feature request related to a problem? Please describe.

In https://docs.ton.org/develop/func/literals_identifiers#string-literals, it's stated that there are no multiline strings, which isn't true — all the same multiline strings from multiline assembly function definitions can be used in expressions. And they also have all the same "string types": s for slices of hex-encoded string contents, a for slices containing MsgAddressInt of address in string contents, etc.

The following just works:

;; somewhere inside of a function body

var a = """
   hash me baby one more time
"""h;
var b = a + 42;

b; ;; 623173419

Describe the solution you'd like

Add description of multiline string literals :)

Additional context

While we're at it — Did you know, that Fift assembly function bodies can have sequences of both singleline and multiline string literals mixed? That is, the following is perfectly valid:

int inc_negate_inc(int x) asm "INC" """
    NEGATE
""" "INC";

...which would increment the value on the stack by 1, negate it, then increment by 1 again and pop it, producing it as a result.

@novusnota novusnota changed the title Add description of multiline strings (FunC) Add description of multiline strings Aug 2, 2024
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

No branches or pull requests

1 participant