diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-10-10 04:32:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-10 04:32:32 +0800 |
commit | b18f717b46d655aa183d09109e1e6cbbc4462c04 (patch) | |
tree | 4c4460de16f16bc17880c128a5cb3eb180ed498e /tools/node.js | |
parent | a0d4b648bbd4bdd0432091fb150d432b9c477367 (diff) | |
download | tracifyjs-b18f717b46d655aa183d09109e1e6cbbc4462c04.tar.gz tracifyjs-b18f717b46d655aa183d09109e1e6cbbc4462c04.zip |
improve readability of `--help ast` (#3460)
Diffstat (limited to 'tools/node.js')
-rw-r--r-- | tools/node.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/node.js b/tools/node.js index a1e14be1..58150e6b 100644 --- a/tools/node.js +++ b/tools/node.js @@ -46,7 +46,9 @@ function describe_ast() { if (ctor.SUBCLASSES.length > 0) { out.space(); out.with_block(function() { - ctor.SUBCLASSES.forEach(function(ctor, i) { + ctor.SUBCLASSES.sort(function(a, b) { + return a.TYPE < b.TYPE ? -1 : 1; + }).forEach(function(ctor, i) { out.indent(); doitem(ctor); out.newline(); |