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"
|
author "Sasha Koshka"
|
||||||
license "GPLv3"
|
license "GPLv3"
|
||||||
require "` + filepath.Join(cwd, "./some/local/module") + `"
|
require "` + filepath.Join(cwd, "./some/local/module") + `"
|
||||||
require "/some/absolute/path/to/someModule"
|
|
||||||
require "/usr/local/include/arf/someLibraryInstalledInStandardLocation"
|
require "/usr/local/include/arf/someLibraryInstalledInStandardLocation"
|
||||||
|
require "/some/absolute/path/to/someModule"
|
||||||
---
|
---
|
||||||
`, test)
|
`, test)
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,8 @@ func (tree SyntaxTree) ToString (indent int) (output string) {
|
|||||||
output += doIndent(indent, "license \"", tree.license, "\"\n")
|
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")
|
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) {
|
func (funcOutput FuncOutput) ToString (indent int) (output string) {
|
||||||
output += doIndent(indent + 1)
|
output += doIndent(indent + 1)
|
||||||
output += "< " + funcOutput.Declaration.ToString()
|
output += "< " + funcOutput.Declaration.ToString()
|
||||||
// why is it always nil??? WHY???
|
|
||||||
if funcOutput.argument.kind != ArgumentKindNil {
|
if funcOutput.argument.kind != ArgumentKindNil {
|
||||||
output += " " + funcOutput.argument.ToString(indent, false)
|
output += " " + funcOutput.argument.ToString(indent, false)
|
||||||
}
|
}
|
||||||
output += "\n"
|
output += "\n"
|
||||||
|
|
||||||
print(funcOutput.argument.ToString(0, true))
|
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user