Sort ToString of requires
This commit is contained in:
parent
a31c975c9d
commit
8b88e1d440
@ -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)
|
||||
}
|
||||
|
@ -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,14 +380,11 @@ 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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user