diff options
Diffstat (limited to 'lex')
-rw-r--r-- | lex/parse.go | 8 | ||||
-rw-r--r-- | lex/type.go | 5 |
2 files changed, 6 insertions, 7 deletions
diff --git a/lex/parse.go b/lex/parse.go index e105a22..00a6cbd 100644 --- a/lex/parse.go +++ b/lex/parse.go @@ -1,8 +1,8 @@ package lex import ( - "io" "bufio" + "io" "strings" ) @@ -18,9 +18,9 @@ func Parse(file io.Reader) (out Screenplay) { var line Line s, err = f.ReadString('\n') split := strings.SplitN(s, ":", 2) - switch len(split){ - case 0,1: - line.Type = strings.Trim(s,": \n\r") + switch len(split) { + case 0, 1: + line.Type = strings.Trim(s, ": \n\r") case 2: line.Type = split[0] line.Contents = strings.TrimSpace(split[1]) diff --git a/lex/type.go b/lex/type.go index eec2f3e..a906ac2 100644 --- a/lex/type.go +++ b/lex/type.go @@ -3,8 +3,7 @@ package lex type Screenplay []Line -type Line struct{ - Type string +type Line struct { + Type string Contents string } - |