• LaggyKar@programming.dev
    link
    fedilink
    arrow-up
    8
    ·
    1 year ago

    How can it tell the difference between spaces used for indentation and spaces used for alignment, if you use the same character for both?

    • coloredgrayscale@programming.dev
      cake
      link
      fedilink
      arrow-up
      3
      ·
      1 year ago

      Maybe alignment more for the righthand side of assignments. If you have a block of variables with different name lengths, or within a constructor / function call.

    • MotoAsh@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      1 year ago

      All parsers ignore a shitload of whitespace already. Just compare unformatted code, COMPLETELY unformatted code, code without character returns, and it’ll become obvious how any given language is interpreted around whitespace.

      Also fun to see just how infrequent a semicolon is ‘actually’ needed to tell when the end of a statement is here.