(elixir) interpolation, sigils and / functions
See original GitHub issueUpdate 11/2019: As far as I know #2257 leaves only item 3 open.
- 1) Interpolation: It cannot deal properly with interpolation.
- 2) Sigils : It cannot deal with these
~S sigil
.~s
is fine though. - 3) Function with a slash ( “Kernel./” ): this one takes
/:
as the beggining of a regular expression (Closed via #2406)
We are adding hightlightjs to https://github.com/elixir-lang/ex_doc/ and when I ran it against the test file for pygments. In addition to #707, I have run into three new issues:
- Interpolation: It cannot deal properly with interpolation.
Every single line bellow, has an issues, it takes it as a comment whatever comes after the #
~R'this + i\s "a" regex too'
~w(hello #{ ["has" <> "123", '\c\d', "\123 interpol" | []] } world)s
~W(hello #{no "123" \c\d \123 interpol} world)s
~s{Escapes terminators \{ and \}, but no {balancing} # outside of sigil here }
~S"No escapes \s\t\n and no #{interpolation}"
- Sigils : It cannot deal with these
~S sigil
.~s
is fine though.
defmodule Long.Module.Name do
@doc ~S'''
No #{interpolation} of any kind.
\000 \x{ff}
\n #{\x{ff}}
'''
def func(a, b \\ []), do: :ok
@doc ~S"""
No #{interpolation} of any kind.
\000 \x{ff}
\n #{\x{ff}}
"""
def func(a, b \\ []), do: :ok
end
- Function with a slash ( “Kernel./” ): this one takes
/:
as the beggining of a regular expression
import Kernel, except: [spawn: 1, +: 2, /: 2, Unless: 2]
You can see this live,
-
Original test doc page, with the problems: http://eksperimental.github.io/issues/highlightjs/Highlight.Elixir.html#pygments/0
-
Page with the problematic lines removed: http://eksperimental.github.io/issues/highlightjs/Highlight.Elixir+.html#pygments/0
Issue Analytics
- State:
- Created 9 years ago
- Reactions:1
- Comments:21 (15 by maintainers)
Top Results From Across the Web
Sigils - The Elixir programming language
Welcome to Elixir, a dynamic, functional language designed for building scalable and ... Interpolation and escaping in string sigils; Calendar sigils.
Read more >Sigils - Elixir School
A list of available sigils include: ~C Generates a character list with no escaping or interpolation.
Read more >Interpolation and escaping in sigils | Elixir - Getting Started
Interpolation and escaping in sigils. Besides lowercase sigils, Elixir supports uppercase sigils to deal with escaping characters and interpolation.
Read more >Elixir - Sigils - Tutorialspoint
Elixir - Sigils, In this chapter, we are going to explore sigils, ... Elixir supports uppercase sigils to deal with escaping characters and...
Read more >Learn With Me: Elixir - Sigils (#41) - The Inquisitive Developer
Sigils are an alternate syntax for certain literals. ... where there is no interpolation or escaping like with a standard string literal.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@eksperimental Sounds like you’re busy - and I haven’t gotten around to this either. I’m just going to run with this as it. It passes all the original examples provided. If there are additional edge cases we can just let people file them as they see them.
Thanks for the offer to help though!
Cool. Thank you!