diff --git a/parser/meta_test.go b/parser/meta_test.go index 467135f..07d3952 100644 --- a/parser/meta_test.go +++ b/parser/meta_test.go @@ -11,8 +11,8 @@ func TestMeta (test *testing.T) { author "Sasha Koshka" license "GPLv3" require "` + filepath.Join(cwd, "./some/local/module") + `" -require "/some/absolute/path/to/someModule" require "/usr/local/include/arf/someLibraryInstalledInStandardLocation" +require "/some/absolute/path/to/someModule" --- `, test) } diff --git a/parser/tree-tostring.go b/parser/tree-tostring.go index ad5e786..0896e16 100644 --- a/parser/tree-tostring.go +++ b/parser/tree-tostring.go @@ -41,7 +41,8 @@ func (tree SyntaxTree) ToString (indent int) (output string) { output += doIndent(indent, "license \"", tree.license, "\"\n") } - for _, require := range tree.requires { + for _, name := range sortMapKeysAlphabetically(tree.requires) { + require := tree.requires[name] output += doIndent(indent, "require \"", require, "\"\n") } @@ -379,13 +380,10 @@ func (phrase Phrase) ToString (indent int, ownLine bool) (output string) { func (funcOutput FuncOutput) ToString (indent int) (output string) { output += doIndent(indent + 1) output += "< " + funcOutput.Declaration.ToString() - // why is it always nil??? WHY??? if funcOutput.argument.kind != ArgumentKindNil { output += " " + funcOutput.argument.ToString(indent, false) } output += "\n" - - print(funcOutput.argument.ToString(0, true)) return }