Skip to content

Commit

Permalink
added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
august95 committed Feb 4, 2025
1 parent 2f99e9c commit 0a8602a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions compiler_lib/lexer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ char lexer::peekChar()
{
return m_file.peek();
}
cerror("could not open test.c");
cerror("could not open test.c"); // add ...
return 'x';
}

Expand All @@ -84,15 +84,15 @@ char lexer::nextChar()
return c;
}

cerror("could not open test.c");
cerror("could not open test.c"); // add ...
return 'x';
}

void lexer::pushChar(char ch)
{
if (!m_file.is_open())
{
cerror("LEX error: could not open test.c");
cerror("LEX error: could not open test.c"); // add ...
return;
}
m_file.putback(ch);
Expand All @@ -111,7 +111,7 @@ void lexer::startLexer()
{
if (!m_file.is_open())
{
cerror("failed to open file");
cerror("failed to open file"); // add ...
return;
}

Expand Down
4 changes: 2 additions & 2 deletions compiler_lib/parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ void parser::parseVariableOrFunction()
}
else
{
cerror("expected function or variable delcaration", token->getFilePosition());
cerror("expected function or variable declaration", token->getFilePosition());
assert(false);
}
pushNode(_node);
Expand Down Expand Up @@ -293,7 +293,7 @@ void parser::parseBody()
token = peekToken(); // '}', parseGlobalKeyword will pop this symbol
if (!token->isTokenTypeSymbol() || token->getCharValue() != '}')
{
cerror("expected symbol '}' at ending of body");
cerror("expected symbol '}' at ending of body", token->getFilePosition());
}

pushNode(body_node);
Expand Down
2 changes: 1 addition & 1 deletion unit_test/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#ifdef __LOCAL__
std::string file_path = "test_files/";
#else
#else // __GTEST__
std::string file_path = "D:/a/braze_compiler/braze_compiler/unit_test/test_files/";
#endif // __LOCAL__

Expand Down
2 changes: 1 addition & 1 deletion unit_test/unit_test.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>X64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>X64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions);__LOCAL__</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<WarningLevel>Level3</WarningLevel>
Expand Down

0 comments on commit 0a8602a

Please sign in to comment.