question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(elixir) interpolation, sigils and / functions

See original GitHub issue

Update 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:

  1. 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}"
  1. 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
  1. 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,

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:1
  • Comments:21 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
joshgoebelcommented, Nov 12, 2019

@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!

0reactions
eksperimentalcommented, Nov 12, 2019

Cool. Thank you!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found