A question about the underhood compilers

So, I know I said compilers, but this will work for command lines, muds, anything that accepts textual input.
My question is... how?
I'll explain. Let's say you're writing a python script which looks like this:

def test():
 print("Hello world!")

How does the compiler read and understand your code? Surely it's not doing something like this...
if current_line.startswith("def")...
if current_line.startswith("if")...
and so on.
How do the compilers, muds, and command lines ignore spaces? These 2 statements  would work equally on windows command line.
cd desktop
cd      desktop
I tried looking for an explanation, but all I've found was a bunch of headache because the explanations were too complex.
Would somebody do me a favor and explain how it all works? You can link to resources and or articles to read, too, just keep in mind that I may lack some knowledge in this area.



-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Jaseoffire via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Jaseoffire via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ian Reed via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : francipvb via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector

Reply via email to