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

Add sigils as per Erlang/OTP 27 #14

Merged
merged 1 commit into from
Apr 11, 2024
Merged

Conversation

KornelH
Copy link

@KornelH KornelH commented Apr 4, 2024

Erlang/OTP 27 [1] introduces sigils (type prefix for string literals) [2].

[1] https://www.erlang.org/news/168
[2] https://www.erlang.org/docs/27/system/data_types.html#sigil

@KornelH KornelH mentioned this pull request Apr 4, 2024
@robertoaloi
Copy link
Member

@KornelH There's a CI failure on this one.

@KornelH
Copy link
Author

KornelH commented Apr 5, 2024

As the test file contains a triple-quoted string without sigil prefix, it requires the the docstring pull request #13 and I didn't want to remove the docstring from the example just to add back later when the docstring pull request is merged. So I just waited for that pull request be merged first and now, this pull request is updated.

Erlang/OTP 27 [1] introduces sigils (type prefix for string literals)
[2].

Additionally, simplify the definition of triple-quoted strings
(docstring) by using back-references in `end` patterns to refer to the
opening character(s) in `begin` patterns. Same simplification is now
used in triple-quoted sigils as well.

[1] https://www.erlang.org/news/168
[2] https://www.erlang.org/docs/27/system/data_types.html#sigil
@KornelH
Copy link
Author

KornelH commented Apr 8, 2024

@robertoaloi, I did some updates on the grammar besides of adding the sigils. I learned that, in end patterns we can refer to capture groups of begin patterns therefore triple-quoted strings (docstring) and triple-quoted sigils (sigil-docstring) are now have only one definition that accepts any number (3+) of double quotes as begin and end caracter sequences.

@robertoaloi robertoaloi merged commit 1817ce0 into erlang-ls:main Apr 11, 2024
1 check passed
@robertoaloi
Copy link
Member

Thanks!

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