Add more tests and small fixes for tag/builder.go

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
High test coverage for builder, close #2

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Add Review to tag builder.go, close #8

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
tag package refactoring.

pair struct is now unexported
parse(io.Reader) ([]pair, error) is now unexported
parseDocument([]pair) (*spdx.Document, error) renamed to build

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Add tag/api.go - the exported functions of tag package

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Package.HasFile renamed to Files

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Initial tag writer implementation

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Fix "errors" imported but not used in tag/api.go

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Initial CLI commit - flags defined (close #13)

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Updates in CLI tool

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Small simplification of flag arguments.

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Initial auto-detection of input format (close #14)

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
tag.Writer fixes

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Initial convertion implementation

Fix autodetect. Auto-detect format does not work on stdin (no extension and difficult to buffer stdin to be re-read)

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
More obvious separation between lexer and parser. Close #18

Adds support for comment tokens.
Each token returned by lexer has line numbers. (start and end)
Bug fix: "prop\nerty:value" now gives an error instead of a property "prop\nerty".

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Update spdx.go to support the new tag lexer/parser.

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Refactor writer.go

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Format action done for Tag format

Fix: writer wasn't adding "#" before comments
Fix: flagConvert was being validate regardless of whether the action is "convert"

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Refactored spdx package so that every element has metadata as well as
the value

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>
Token.Meta is now a *spdx.Meta pointer

Signed-off-by: Vlad Velici <vlad.velici@gmail.com>