WriteLine(); being funky
I'm writing a linker and for some reason print is doing REALLY weird things, as you see in the image
69 Replies
This chunk has the code for printing
can you provide a bit more code explaining/showing what line is
also to avoid issues I would change this bit
Depending what line is I might use different methods to get the filename
this removes the need to add \\ at the end of filedir and potentially avoid duplicated empty dir
Mainfile is passed here
it gets the file path
and then check if it exists, pretty simple, then if it doesnt, it throws an error
and for some reason print is screwing up
I think the red checks u see are a powershell thing, try running your code from prompt instead
I would assume % evaluates to something in powershell and its marking it as wrong syntax or something
No, if you look at the code, It is there made by me
Console.WriteLine(new string('^', line.Length - 1));
It all works fine, but for some reason it can't print rightyou mean this part not printing to the console?
or what is not right I might be missing something
and have u tried it outside powershell to see if the result is the same out of curiosity
Power shell shouldnโt be the issue, but I can try
I donโt like cmd
But if it works it works
It is not a power shell issue, just tried
Fixed it
yeah I am just rying to rule out the output being the issue
it was windows adding a "\r"
ah from the line input yeah makes sense
I hate that, bash doesnt do that, but ol windows and it's \n\r
u could just have a [1].Trim()
true ig
but I've been programing on linux for a few weeks so I forgot
yeah that was one of the reasons I was curious about what the line was
because u were oddly removing some stuff from it
It was so It looked print friendly
the path would look like this "..\..\..\standard\hello.hyd"
plus
"F:\Projects\Hydro\bin\debug\net8.0\..\..\..\standard\hello.hyd
like that
yeah that's awful
truly this
"F:\Projects\Hydro\bin\debug\net8.0/../../../standard/hello.hyd"
imagine that
but if all u want is hyd files
can't u just do a recursive file search on root and that gives u all hyd files with their respective full path
well it's a programming language
I only want to link what the user wants
I see so, I guess you're doing
- read file selected by user
- get the includes from the top of that file
- format the includes
- verify the include exists
It doesn't get them from the top, it gets them from anywhere, and yes
sure you read all lines for what starts with %include
yeah
well glad you figured it out ๐
let me find one thing
includes anywhere
now let me make that file path
and hope it works
when u distribute the files do u expect it to be on the root of the executable or what
As in?
It gets the path of the main hyd file
and bases it off that
lets go
ah I see so if I pass in the command line argument c:\x\y\z.hyd
it will assume c:\x\y
yeah as the dir
Im so proud bc I program in C and ASM so high level langs like this are a bit odd to me
classes
I mean u could have done it in c just as easily then
yeah but it's a lot more work bc I have to use malloc and free ALL the time
I cant just do
char* hello = "Hello";
char* world = "World";
hello += world;
bc char pointers
I have to use
strcpy(hello, world, strlen(world));
or
that is C right there
painful
but useful
I mean I know c and c++ all I am saying is that not a whole lot of more code to make it so incovinient
I know but memory management in a compiler is hard
and C# just had so many features useful to it
Plus I use C differently
I love my OSDEV
GC is not always that great thou keep that in mind
I know
but im lazy
so C is too much work
unless adhd hyperfixation
Looks clean
reason I am not replacing / is because windows recognizes both patterns so not sure its actually needed.
for folder path
I replace it so it looks nice to the user
yeah normalized I would say
but you probably have more checks in place in the event split fails or the result is empty I assume
:)
this should answer ur question
it's a feature now
if you make a typo
sure
that works
split on the quote instead ๐
nahhhh
I got a new feature
what the a symbolizes in this new feature
if you make a typo it errors
perfect
Never heard of hydro got to check that later
Not much rn
fear my void pointer
is that a language you're creating or
Yeah
yummy
aww
it couldnt handle the void pointer
u would have to do something like
fixed code that gets the entrypoint and dereference it
it's horrible and amazing
putting the C in C#