elixir-makeup / makeup_erlang Goto Github PK
View Code? Open in Web Editor NEWErlang lexer for Makeup
Erlang lexer for Makeup
The Erlang code in this OTP doc page has tabs in it that are being interpreted and rendered as errors.
https://www.erlang.org/doc/system/erl_interface.html
Not sure if this repo is where this is actually happening, but making an issue to keep track of it. Assuming that since it's Erlang code and exdoc that the error is here.
Looks like the problem occurs in the lexer, \s
is used but not sure what that is in this context - confusion with regex? and \t
is missing.
https://github.com/elixir-makeup/makeup_erlang/blob/master/lib/makeup/lexers/erlang_lexer.ex#L17
I'll make a PR.
When we get to a point where we can use this package to highlight erlang
code in ex_doc
, we should create a release of this package in Hex as to not include the dependency straight from github.
iex(1)> Makeup.highlight("fun($๐ซ ) -> ok.", lexer: Makeup.Lexers.ErlangLexer)
** (MatchError) no match of right hand side value: {:ok, [{:whitespace, %{language: :erlang}, "\n"}, {:name_function, %{language: :erlang}, "fun"}, {:punctuation, %{language: :erlang}, "("}, {:string_char, %{language: :erlang}, ["$", 240]}], <<159, 171, 130, 32, 41, 32, 45, 62, 32, 111, 107, 46>>, %{}, {2, 1}, 7}
(makeup_erlang 0.1.5) lib/makeup/lexers/erlang_lexer.ex:442: Makeup.Lexers.ErlangLexer.lex/2
(makeup 1.1.1) lib/makeup.ex:37: Makeup.highlight/2
iex:1: (file)
Erlang prompt by default is 1>
, 2>
, etc. Let's make it unselectable, similarly to how iex>
is treated.
The license is stated as "BSD" in mix.exs
. Anyhow, there are many different versions of this the BSD license. Which one excly is it?
I get the following when compiling:
warning: Application.get_env/3 is discouraged in the module body, use Application.compile_env/3 instead
Warning: lib/makeup/lexers/erlang_lexer.ex:250: Makeup.Lexers.ErlangLexer
Couple improvements that I think would be nice to do (referencend from this comment).
module:function()
(example)-spec function(type()) -> type().
(example)#record{attribute = value}
(example)(Things I would like to discuss)
function/0
?binary
, bitstring
, number of bytes) in binary pattern match <<"string", Rest/binary>>
?The only reason we might need the lexeme is if we need to pattern match on variable names later, for grouping purposes, for example. I believe I do that in the Elixir lexer (I haven't looked at the source in some time).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.