Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT] build ast and with debug function #38

Merged
merged 42 commits into from
Dec 23, 2023
Merged

[FEAT] build ast and with debug function #38

merged 42 commits into from
Dec 23, 2023

Conversation

LeaYeh
Copy link
Owner

@LeaYeh LeaYeh commented Dec 23, 2023

Resolve #35

@itislu
Copy link
Collaborator

itislu commented Dec 23, 2023

@LeaYeh We should remove Issue #35 from this PR because it is about removing the function from libft.
Issue #22 is about the refactoring in the parser.

itislu and others added 28 commits December 23, 2023 21:25
Implementation:
After the token_list has been created and the token types have been set,
there is now a second stage that goes through the token_list again and
changes any mislabeled T_ASSIGNMENT_WORD token types to T_WORD.
These additions tell the compiler to separate the compile process into 3 stages:
1. Pre-processing:
Creates .d files which keep track of all header file dependencies.
2. Compiling:
Compiles the source files into object files.
3. Linking:
Links the object files into an executable.

Now, whenever something in a header file changes, all source files that include this header file will recompile, even if nothing in the source files themselves changed.
When something in a library changes, the main project should be recompiled.

But there's a bug:
Because of the -j MAKEFLAG, multiple make jobs get executed at the same time. This means the library files might get checked for changes before the library actually compiles any changes.
In that case, make has to be run again to include the updated library into the main executable.
The -s flag silences everything coming from Make.
Therefore no other steps to silence printouts are needed anymore and have been removed.

What kind of messages should get printed out is determined by the exit codes of new instances of Make and AND and OR operations.
This message handling rule is now the default for the 'all' goal and gets checked everytime Make is run.

The actual build prerequisites have been moved to a new goal, called 'build'.
Now the ft_lstclear and ft_lstdelone functions still free the node even when the function pointer argument is NULL. This really is more useful.

And the ft_lstpop function now also sets the next ptr for the popped node to NULL.
@itislu itislu merged commit 034f7d9 into main Dec 23, 2023
1 check passed
@itislu itislu deleted the feat-build-ast branch December 23, 2023 21:18
@itislu itislu self-assigned this Dec 23, 2023
@itislu itislu added the feature New feature of the project label Dec 23, 2023
@itislu itislu added this to the Parser milestone Dec 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature of the project
Projects
None yet
2 participants