From b18f717b46d655aa183d09109e1e6cbbc4462c04 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 10 Oct 2019 04:32:32 +0800 Subject: [PATCH] improve readability of `--help ast` (#3460) --- tools/node.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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(); -- 2.34.1