Which source file contains the lexer (scanner) for make file?
Like Python, 'make' files need indentation.
'make' needs that the indented line be spaced by a tab, and putting instead spaces (for getting the same number of spaces, as a tab) wouldn't work. I assume that this task of checking if a tab is there before any indented line, is done by the scanner (lexer/lexical analyzer) for the 'make' utility. Please tell where to locate the same in the source code of the make utility. Am working in cygwin, but assume that the path of the file would be the same as in Linux. |
no, that is not indentation, but anyway if you wish you can call it indentation. The tab (one tab character) at the beginning of the lines is a requirement, otherwise the indentation (or spacing) is irrelevant.
It is explained here: https://www.gnu.org/software/make/ma...le-Syntax.html The source code can be found here: https://git.savannah.gnu.org/cgit/ma...c?h=4.4.1#n570 It has its own solution, it doesn't use lexer. |
Quote:
Please tell why the line #1008 (&, at line #1162), starts with an opening brace, when there is no function's start for the same. It seems like a scope, which have forgotten; i.e. one without a function definition. P.S.: Also, seems the code block ends at the line #1982, as by putting in VS, could see the ending of the opening brace there. So, if am correct, it is a 1412 lines of code block. P.S.(1) : Might be am wrong, as seems the end of the block is further down. Please indicate, where the end lies, as difficult to check just by using VS editor. |
Quote:
The block from #1008 to #1346 is for scope (see comment preceeding it). |
Quote:
|
Quote:
Even VS seems to not help, as easily got confused by that to go much further (i.e., till the line #1982), than the end of the block stated by you. Have read something here, that states to make own lexer, for the makefiles, in the response by @gstavi; but couldn't make much sense out of it. Anyway, am amazed how you found out so quickly, as where the code block correctly ends. |
Quote:
|
1 Attachment(s)
Quote:
Also, looked here; but not helped again. Tried youtube video, but didn't help. Tried WSL for running ubuntu on windows. But, still didn't help though vim works. The result is attached herewith (though am suggested here to not attach), in order to ask for help; which feel is lesser than what is needed by me. |
I don't understand. Can't you just press the % key?
|
How would that help with anything? Anyways, if vim is problematic, try mcedit, it has an ESC b sequence for this (or Alt+b)
|
Quote:
Am also confused as why nowhere (book, webpage, youtube) is shown the 'actual' effect of pressing %; at least a video could have shown it. I tried many times, by placing the cursor at the line #571, & pressing % key; but failed to see what happens. Just the cursor disappears, but how to go down so much below is really an issue; that too by pressing the 'down' key! Wish if you could please show what it achieves. Have tried for hundreds of times, but of no avail. |
1 Attachment(s)
Quote:
That would have opened the path for future needs being satisfied myself. Also, mcedit (if am not wrong) is an acronym for 'MidNight Commander', which am unsure of still. The site here hope is in correct direction, please vindicate. ----- P.S. : Have installed mcedit, but seems that need to see the line numbers at the top (as the option for adding the line number, as stated here does make no difference; in terms of adding line numbers to the left end, as in vim), rather than at the left end of each line, as in vim. But, still don't know how to see the matching close brace line by using 'Alt+b'. |
First move the cursor onto a { or } character, then press Alt+b
You can practice with another key combination: Alt+n (or Esc n) toggles line numbers on/off. |
1 Attachment(s)
Quote:
Also, please help (if possible) in implementing the idea of @gstavi in (my) post #6. |
First try another file or location, where you can see both the opening and closing bracket/paren and press %. You will see how the cursor is moving.
Your case is almost the same, just the cursor is moving out of the display (probably). see https://www.youtube.com/watch?v=K05TpcntFXs&t=320s |
All times are GMT -5. The time now is 06:12 PM. |