Skip to content

Mabofoul/move newline to end#5

Open
NoneSince wants to merge 17 commits into
Thomas-995:masterfrom
NoneSince:mabofoul/move_newline_to_end
Open

Mabofoul/move newline to end#5
NoneSince wants to merge 17 commits into
Thomas-995:masterfrom
NoneSince:mabofoul/move_newline_to_end

Conversation

@NoneSince

Copy link
Copy Markdown

output asm file started with an empty line and didn't end with an empty line

NoneSince and others added 17 commits January 25, 2024 00:44
…s of header files, removed boost dependancy, removed/added spaces. included @xtrm-en work of PR #1, except his makefile (his makefile is better but i wont copy others work)
ordering CON_TOKENTYPE handlers/types like ordered in enum CON_TOKENTYPE
The reason: i want to push the changs one step at a time to make it easier to review.
src/*: whitespaces
src/construct.cpp: added a note you explained in the youtube video
README.md: added eexplaination for "-o" flag
warning 2: functions missing return statements
warning 3: for loop index is of type int but is compared to a value of type size_t
…t. also it is used in src/construct_flags.cpp so i added declaration.

con_type looks like the token types while also being only used in the file itself so i renamed to _con_type.
apply_macro_to_token() is used only in the file itself, so i set it as static and removed it from the header.
cstring is included for strcmp. so I replaced it with std::string comparison.
boost is used for split, is_any_of, and to_lower. so I implemented the functionality we need.
… the types and functions you directly use, and not depend on the current header files to complete the needed includes.

for example: the file src/construct_flags.h only needs to know the type std::string, so only #include <string>, and since the function implementation appears in src/construct_flags.cpp, it also needs an #include <string>.
you should put that same include in both .h and .cpp files, since technically the .h file can be empty, then it won't have includes for arguments types, the .cpp has to do the includes.
explaination for the importance of this rule: i remember something like this: <string> under one compiler / operating system does #include <algorithm> inside the header, so the program in the story ran filne without noticing the need of direct #include <algorithm>. once the same code was compiled with a different compiler / OS, it failed compilation since <algorithm> was not included.
…hrow error;".

before, an error could go unnoticed, but now the program will end automatically (I didn't do try-catch)

@Thomas-995 Thomas-995 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is more of a naming issue, but I see no reason to confine the reg_to_str function to ONLY being able to use the current used bitwidth it just looks cleaner with it as an input parameter. The naming on the bitwidth variable should definitely be something else though to avoid this kind of confusion. Kind of same thing with the static function thing, it's not like the function should NEVER be used from any other file so I see no reason to make it static (though if you have a good reason it could be right). Also you say you changed it to _con_type but I dont see any such change in the code, only for con_condition?

@NoneSince

Copy link
Copy Markdown
Author

Replied in PR #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants