Commit graph

460 commits

Author SHA1 Message Date
9fb4e13420
implement tree debug for redirections 2025-03-28 14:50:37 +01:00
88ed66e138
refactor cmdlist.num_cmds -> cmdlist.num_cmd to be more consistent 2025-03-28 14:50:37 +01:00
448458b37f
redirection parsing: parse redirections for cmdgroup 2025-03-28 14:50:37 +01:00
c258fa6077
fix(simple_cmd): did not free redirection list correctly 2025-03-28 14:50:37 +01:00
0584757446
refactor: put parsing of command and debugging out of main loop 2025-03-28 14:50:37 +01:00
36c1b72eff
tests: implement a better integration test framework than shellspec
(for our usecase at least)
2025-03-28 14:50:37 +01:00
1f03cbbedb
tree debug: implement rest of tree debug
This is a big commit, sorry!
2025-03-28 14:50:37 +01:00
76b2b8ec7f
treedrawing: fix bug where rare circumstances could lead to incorrect indent
The problem took me a while to find, but the issue here was that push_buf does
not add a terminating null byte, and I was only asking push_buf to copy the
bytes that contained characters, not the terminating null byte as well.

This, combined with the fact that to remove bytes from the end of the buffer, I
just placed a null byte a the end, caused some combinations of indentation and
dedentations to overwrite the null byte, and not place a null byte after the new
indent, which would still contain data from a previous indentation.
2025-03-28 14:50:37 +01:00
1486c3b124
treeprint refactor: use simpler types 2025-03-28 14:50:37 +01:00
3edff91107
cmdgroup parsing: parse a single cmdlist 2025-03-28 14:50:37 +01:00
5379ad34f2
cmdlist debug: implement debug func (STUB)
I need to actually parse some cmdlists for this to have any meaning further
2025-03-28 14:50:37 +01:00
40c5164eef
tree debug: create library for easy indent/dedent 2025-03-28 14:50:37 +01:00
47a61699ab
cmdlist debug: tree debug printing (STUB) 2025-03-28 14:50:37 +01:00
131ba36d93
cmdlist refactor: use cmdlist instead of command_list as a shorthand
I hope this doesn't break too much code ^^
2025-03-28 14:50:37 +01:00
56fe943efc
cmdlist: use new architecture (STUB)
I fixed the tests, and the basic functionallity of detecting pipelines works,
but detecting nested cmdgroups is not yet implemented
2025-03-28 14:50:37 +01:00
8f7e7f7dfe
cmdgroup: tree debug routine 2025-03-28 14:50:37 +01:00
55d21196b8
cmdgroup: start implementing debug routines 2025-03-28 14:50:37 +01:00
d069abcd43
Makefile: add rules to build main executable with sanitizers 2025-03-28 14:50:37 +01:00
f9aa614ef2
cmdgroup parsing: start implementing the new architecture 2025-03-28 14:50:37 +01:00
d6bb24df54
cmdgroup parsing: ensure parsing of a pipeline functions correctly 2025-03-28 14:50:37 +01:00
0f0d3ea0bd
notes: new architecture for cmdgroup 2025-03-28 14:50:37 +01:00
d8dd1613c8
cmdgroup parsing: handle parsing a single cmdlist (badly) 2025-03-28 14:50:37 +01:00
9707316085
tests: put usefull test functions in own files 2025-03-28 14:50:37 +01:00
f5ae3a5d8d
tests: add a test_ prefix to all files that contain actual tests
This will make it easier to differentiate with utility files, as the next change
will add sevral
2025-03-28 14:50:37 +01:00
bc5be67bf6
cmdgroup parsing: parse empty wordlist 2025-03-28 14:50:37 +01:00
8f919b33df
notes: some notes about the implementation of cmdgroup 2025-03-28 14:50:37 +01:00
Jérôme Guélen
c73884e43a
Expansion: Added documentation for wildcard checking 2025-03-24 13:52:42 +01:00
Jérôme Guélen
08d883b792
Expansion: fixed one documenting comment. 2025-03-24 10:53:02 +01:00
Jérôme Guélen
d5415d978c
Expansion: one fix to make sur $? is handled correctly 2025-03-24 10:48:05 +01:00
Jérôme Guélen
2a61706f1a
Expansion: Most changes dealt with 2025-03-21 18:54:10 +01:00
532d71efb0
remove outdated comment 2025-03-21 14:41:00 +01:00
10b1ac6711
expansion: add some more test cases 2025-03-21 14:07:00 +01:00
b714351d4d
remove debug print in wildcard_exp 2025-03-21 13:51:25 +01:00
0d4edd4809
fix compile issues with duplicate function defs 2025-03-21 13:50:46 +01:00
Jérôme Guélen
00f27ae05c
Expansion: fixed the algo for star expansion. 2025-03-21 10:44:39 +01:00
41c9548934
some pair debugging 2025-03-21 10:44:39 +01:00
46c288c858
wordlist: add a function to debug-print a wordlist 2025-03-21 10:44:37 +01:00
Jérôme Guélen
b58848e091
Expansion: fix but still a problem matching '.'
Problem in the coherence of behaviour regarding ownership with star expansion
fixed.
2025-03-21 10:42:46 +01:00
Jérôme Guélen
da06c0d4e0
Expansion: one little problem remaining with * expansion and . 2025-03-21 10:16:00 +01:00
Jérôme Guélen
2da7f03a66
Expansion: Test directory for future portability
Tests to be readjusted for portability.
2025-03-21 10:15:10 +01:00
f0755cd6c4
tests: some fixes 2025-03-21 10:14:37 +01:00
Jérôme Guélen
ea3ecaaf31
Expansion: temporarily sharing broken version 2025-03-21 10:14:37 +01:00
Jérôme Guélen
0f8b18b32f
Expansion: Fixed inclusions and Norm checked
Now on to remake tests properly.
2025-03-21 10:14:37 +01:00
Jérôme Guélen
bed41f4a6f
Expansion: A fix attempt
No time left to check before going home
2025-03-21 10:14:34 +01:00
Jérôme Guélen
35d391a813
Expansion: Pre dividing of filepath_from_env
I still need to implement the cleaning of filename that is passed to expand_star
Recheck .h files in case I forgot to declare some of my functions in them.
Recheck if the Makefile indeed has all the sources listed.
Rework the tests after the evolution of our structures.
2025-03-21 10:13:54 +01:00
Jérôme Guélen
fc12d8e057
Expansion: fix: algo was wrong for wildcard
Hopefully, this is a proper fix. This commit serves mainly to save
advancement.
2025-03-21 10:12:56 +01:00
Jérôme Guélen
1766e8d1ba
Expansion: not dealing with potential directory yet 2025-03-21 10:11:58 +01:00
Jérôme Guélen
efae95950e
Expansion: pre split discussion
I forgot to code the minishell_split function.
2025-03-21 10:11:58 +01:00
Jérôme Guélen
de53d2b8bc
Expansion: Norm recheck 2025-03-21 10:11:58 +01:00
Jérôme Guélen
a41f10eda3
Expansion: wildcard exp v1.0
Checks still need to be made.
2025-03-21 10:11:58 +01:00