Permalink
Browse files

Fix line numbers

  • Loading branch information...
1 parent edec5ac commit 6a9845fedf04c3d465b5d3bc259e5b0e1a1219ea @evanmiller evanmiller committed Feb 15, 2013
Showing with 6 additions and 3 deletions.
  1. +6 −3 src/erlydtl_scanner.erl
View
@@ -190,13 +190,16 @@ scan("%}" ++ T, Scanned, {Row, Column}, {in_endverbatim_code, "", _BackTrack, un
scan(T, Scanned, {Row, Column + 2}, in_text);
scan([H|T], [{string, Pos, Data}|Scanned], {Row, Column}, {in_endverbatim_code, _, BackTrack, Tag}) ->
- scan(T, [{string, Pos, [H|BackTrack] ++ Data}|Scanned], {Row, Column + 1}, {in_verbatim, Tag});
+ NewPos = case H of $\n -> {Row + 1, 1}; _ -> {Row, Column + 1} end,
+ scan(T, [{string, Pos, [H|BackTrack] ++ Data}|Scanned], NewPos, {in_verbatim, Tag});
scan([H|T], [{string, Pos, Data}|Scanned], {Row, Column}, {in_verbatim_code, BackTrack, Tag}) ->
- scan(T, [{string, Pos, [H|BackTrack] ++ Data}|Scanned], {Row, Column + 1}, {in_verbatim, Tag});
+ NewPos = case H of $\n -> {Row + 1, 1}; _ -> {Row, Column + 1} end,
+ scan(T, [{string, Pos, [H|BackTrack] ++ Data}|Scanned], NewPos, {in_verbatim, Tag});
scan([H|T], [{string, Pos, Data}|Scanned], {Row, Column}, {in_verbatim, Tag}) ->
- scan(T, [{string, Pos, [H|Data]}|Scanned], {Row, Column + 1}, {in_verbatim, Tag});
+ NewPos = case H of $\n -> {Row + 1, 1}; _ -> {Row, Column + 1} end,
+ scan(T, [{string, Pos, [H|Data]}|Scanned], NewPos, {in_verbatim, Tag});
scan("==" ++ T, Scanned, {Row, Column}, {_, Closer}) ->
scan(T, [{'==', {Row, Column}} | Scanned], {Row, Column + 2}, {in_code, Closer});

0 comments on commit 6a9845f

Please sign in to comment.