是否可以通过人为方式解决缩进大小问题 w/o 访问语法树?

Is it humanly possible to fix indent size issues w/o access to a syntax tree?

换个方式问,如果我给你看这个被屏蔽的代码文件,只用你的人脑,是否有可能解决缩进问题,即使你知道它应该是 2-space 缩进?

  xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
   xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
     xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    x
x

   xxxxxxxxxxxxxxxxxxxxxxxxxxx

我有自己的想法,但不想让答案有偏见。真正的源代码和语言将在我得到一批好的答案后公布。请随意 post 您的修复作为下面的代码块。

此测试假设如下:

  1. 你不知道这段代码是用什么语言编写的。
  2. 您只知道有多少 space 或制表符指向每一行的第一个字符。在这种情况下,没有制表符(只有 spaces)。
  3. 您知道缩进尺寸应该是多少。在这种情况下,2 spaces.

注:如果人脑可以,代码也应该可以吧?

奖励积分(可选):你会如何分解逻辑来解决这个问题?

编辑:这是创建这些 exe 的源代码:

function greet(firstName, lastName) {

    var firstName = prompt('What is your first name?');
    var lastName = prompt('Last name?');

    var fullName = firstName + ' ' + lastName;
    for (var i = 0; i < 10; i++) {
        console.log('Hello,', fullName + '!');
    }
}

greet(firstName, lastName);
 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
       xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

            xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
                x
            x

    xxxxxxxxxxxxxxxxxxxxxxxxxxx