Skip to content

String literals #264

@mbenke

Description

@mbenke

Idea:

import dispatch;
// function f() -> memory(string) { return "uint256"; }) should desugar to

function stringLit75696e74323536() -> memory(string) {
        let size : word = 7;
	let ptr = allocate_memory(64);
        assembly {
            mstore(ptr, size)
            mstore(add(ptr,32), 0x75696e7432353600000000000000000000000000000000000000000000000000)
        }
	return memory(ptr);
}

function f() -> memory(string) {
  return stringLit75696e74323536();
}

with appropriate chunking for longer strings.

Parts of #176 can be reused.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions