Permalink
Browse files

Merge branch 'master' of github.com:evanmiller/erlydtl

Conflicts:
	src/erlydtl_compiler.erl
  • Loading branch information...
2 parents 694fc92 + 6a3c8f2 commit 8da2184f83ba4f27ca4e7781c1ddc51d773c0208 Evan Miller committed Jun 24, 2011
Showing with 15 additions and 10 deletions.
  1. +2 −2 .gitignore
  2. +11 −6 src/erlydtl_compiler.erl
  3. +2 −2 src/erlydtl_scanner.erl
View
4 .gitignore
@@ -1,5 +1,5 @@
-*.beam
+ebin
*.swp
erl_crash.dump
examples/rendered_output
-src/erlydtl/erlydtl_parser.erl
+src/erlydtl_parser.erl
View
17 src/erlydtl_compiler.erl
@@ -116,12 +116,17 @@ compile_dir(Dir, Module, Options) ->
Files = filelib:fold_files(Dir, ".*", true, fun(F1,Acc1) -> [F1 | Acc1] end, []),
{ParserResults, ParserErrors} = lists:foldl(fun
("."++_, Acc) -> Acc;
- (FilePath, {ResultAcc, ErrorAcc}) ->
- File = filename:basename(FilePath),
- case parse(FilePath, Context) of
- ok -> {ResultAcc, ErrorAcc};
- {ok, DjangoParseTree, CheckSum} -> {[{File, DjangoParseTree, CheckSum}|ResultAcc], ErrorAcc};
- Err -> {ResultAcc, [Err|ErrorAcc]}
+ (File, {ResultAcc, ErrorAcc}) ->
+ FilePath = filename:join([Dir, File]),
+ case filelib:is_dir(FilePath) of
+ true ->
+ {ResultAcc, ErrorAcc};
+ false ->
+ case parse(FilePath, Context) of
+ ok -> {ResultAcc, ErrorAcc};
+ {ok, DjangoParseTree, CheckSum} -> {[{File, DjangoParseTree, CheckSum}|ResultAcc], ErrorAcc};
+ Err -> {ResultAcc, [Err|ErrorAcc]}
+ end
end
end, {[], []}, Files),
case ParserErrors of
View
4 src/erlydtl_scanner.erl 100755 → 100644
@@ -200,14 +200,14 @@ scan([H | T], Scanned, {Row, Column}, {in_single_quote, Closer}) ->
scan("}}-->" ++ T, Scanned, {Row, Column}, {_, "}}-->"}) ->
scan(T, [{close_var, {Row, Column}, '}}-->'} | Scanned],
- {Row, Column + 2}, in_text);
+ {Row, Column + length("}}-->")}, in_text);
scan("}}" ++ T, Scanned, {Row, Column}, {_, "}}"}) ->
scan(T, [{close_var, {Row, Column}, '}}'} | Scanned], {Row, Column + 2}, in_text);
scan("%}-->" ++ T, Scanned, {Row, Column}, {_, "%}-->"}) ->
scan(T, [{close_tag, {Row, Column}, '%}-->'} | Scanned],
- {Row, Column + 2}, in_text);
+ {Row, Column + length("%}-->")}, in_text);
scan("%}" ++ T, Scanned, {Row, Column}, {_, "%}"}) ->
scan(T, [{close_tag, {Row, Column}, '%}'} | Scanned],

0 comments on commit 8da2184

Please sign in to comment.