asummers / erlex

Convert Erlang style structs and error messages to equivalent Elixir.
Other
34 stars 17 forks source link

Fix lexer to tokenize triple '<' properly #44

Closed barthez closed 4 years ago

barthez commented 4 years ago

It was producing [<<, <] but it should [<, <<]. Added lexer rule with push back to fix it.

I was having troubles with dialyzer formatter to parse: <<<_:8,_:_*1>>,'false'>

codecov[bot] commented 4 years ago

Codecov Report

Merging #44 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #44   +/-   ##
=======================================
  Coverage   86.01%   86.01%           
=======================================
  Files           1        1           
  Lines         143      143           
=======================================
  Hits          123      123           
  Misses         20       20

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 35986f7...cd0ee37. Read the comment docs.

barthez commented 4 years ago

Related to

asummers commented 4 years ago

I will have to test this later. I worry this will choke on e.g. <<<x,y>, z>, w> type inputs and we need to be smarter.

asummers commented 4 years ago

I think this instead needs to be solved by removing << and >> a lexed characters and then <<x>> needs to be parsed separately instead.

asummers commented 4 years ago

Thank you for the proposed fix! :purple_heart:

I stole your test in #45. I wound up removing some of the parsing tokens instead of adding a new token to the lexer.