Skip to content

Commit

Permalink
fix for 0.20.5 (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
f authored and sdogruyol committed Feb 1, 2017
1 parent 5d5db52 commit ec13cd6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/parser.cr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Parser
LINE_RE = /^\s*--\s*name:\s*([a-z\_\?\!0-9]+)(\(.*?\)|).*?\n/
LINE_RE = /^\s*--\s*name:\s*([a-z\_\?\!0-9]+)(\(.*?\)|).*?$/
PARAM_RE = /\{\{(.*?)\}\}/
PARAM_RAW_RE = /\{\{\!(.*?)\}\}/

Expand All @@ -23,7 +23,7 @@ class Parser
@sql_lines << sql
end
end
define_method(@metadata, @sql_lines.each.join("\n"))
define_method(@metadata, @sql_lines.each.join("\\n"))
@sql_lines.clear
end
end
Expand All @@ -32,7 +32,7 @@ class Parser
# checks if the given line contains metadata
# example: -- name: get_users(name, surname)
def metadata?(line)
line.match(LINE_RE)
line.chomp.match(LINE_RE)
end

# checks for lines that is neither comment line (starts with -- )
Expand Down

0 comments on commit ec13cd6

Please sign in to comment.