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

External variable names that are not valid identifiers #14210

Open
HertzDevil opened this issue Jan 10, 2024 · 0 comments
Open

External variable names that are not valid identifiers #14210

HertzDevil opened this issue Jan 10, 2024 · 0 comments

Comments

@HertzDevil
Copy link
Contributor

Funs inside a lib can have a quoted real name if that name cannot be represented as a Crystal identifier:

lib Lib
  fun foo = "llvm.ceil.f32"
end

The same cannot be done for external variables:

lib Lib
  $foo = "llvm.ceil.f32" : Int32 # Error: expecting any of these tokens: IDENT, CONST (not 'DELIMITER_START')
end

Since both are similarly mangled and Crystal doesn't have control over the mangling scheme, I think we should allow quoted strings here for external variables too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant