revert-complexity #7

Merged
sashakoshka merged 34 commits from revert-complexity into main 2022-09-29 14:06:54 -06:00
2 changed files with 3 additions and 5 deletions
Showing only changes of commit 8b88e1d440 - Show all commits

View File

@ -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)
}

View File

@ -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
}