commit | 79abd180b7a2f4f49cbed064918abd369d421b4b | [log] [tgz] |
---|---|---|
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | Fri Apr 03 11:07:38 2015 +0900 |
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | Fri Apr 03 11:07:38 2015 +0900 |
tree | cf839874bd52037bbd2ebdf131e5ebf94c05a17e | |
parent | 76de43e8970a48bfaa2a1c26bb5a702666e49cc6 [diff] [blame] |
Fix behaviors for whitespaces Also add a couple of tests.
diff --git a/parser.go b/parser.go index f461646..13da4df 100644 --- a/parser.go +++ b/parser.go
@@ -134,7 +134,7 @@ if len(line) == 0 { break } else if line[0] == '\t' { - ast.cmds = append(ast.cmds, string(bytes.TrimSpace(line))) + ast.cmds = append(ast.cmds, string(bytes.TrimLeft(line, " \t"))) } else { p.unreadLine(line) break