From ec13cd64c54c787ccc4122ed256509e78f864044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20Kadir=20Ak=C4=B1n?= Date: Thu, 2 Feb 2017 00:11:32 +0300 Subject: [PATCH] fix for 0.20.5 (#11) --- src/parser.cr | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parser.cr b/src/parser.cr index ca8831f..ffafbf6 100644 --- a/src/parser.cr +++ b/src/parser.cr @@ -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 = /\{\{\!(.*?)\}\}/ @@ -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 @@ -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 -- )