What is the principle of compiling sass and less into css?

in the interview two days ago, the interviewer asked me this question. I did not find the answer myself, nor did I think of how to describe the question. I would also like to ask the passing god to answer it. What should I do if I am asked during the interview what is the principle of compiling sass and less into css?

May.22,2021

I think it's best to answer compilation principles directly. The simplest and most straightforward answer to
is that it can be implemented with string substitution. According to the css syntax specification, replace sass and less with css : F (sass) = > css . It would be nice to implement such a string processing function, and how to implement it can be explained by the theoretical knowledge of compilation principle .
A rough personal opinion without going into details.


this is the working schematic diagram of less (provided by the official website): https://go.gliffy.com/go/publ., the steps seem quite complicated.
I don't think the interviewer will ask for too much detail. When it comes to the question that can say AST (abstract syntax tree) and know probably the principle of AST, it will OK

.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bfe98e-3a7c9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bfe98e-3a7c9.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?