Skip to content

Commit

Permalink
v1.06
Browse files Browse the repository at this point in the history
- Improved JASS syntax support
- Now one-line blocks are supported
- Fixed bug with lambdas
- Fixed string concatenation have been not recognizeble with string constants
- Fixed race condition with logs clean-up
- Added visible progress
- Minor improvements
  • Loading branch information
Geogriy committed Nov 21, 2019
1 parent c04ec44 commit 85a4d3a
Show file tree
Hide file tree
Showing 15 changed files with 358 additions and 47 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Warcraft III Reforged brought us Lua scripting, but still a lot of map makers fo
- Read logs if something goes wrong, this application leaves cjass2lua.log file with all it's actions and possible problems. Everything should be fine if you have no warnings.

### Latest release
- [v1.05](https://github.com/fullmetal-a/cjass2lua/releases/tag/v1.05)
- [v1.06](https://github.com/fullmetal-a/cjass2lua/releases/tag/v1.06)

### Manual
#### GUI
Expand Down
5 changes: 3 additions & 2 deletions cJass2Lua/Logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace _____LOGGER
{
std::mutex Logger::Writer::_writeMutex;
std::recursive_mutex Logger::Writer::_writeMutex;

std::string _generateTimeStamp()
{
Expand Down Expand Up @@ -101,13 +101,14 @@ namespace _____LOGGER

Logger::Writer::Writer(std::string file, const std::string& func, int line, Level level, Logger& logger) : _logger(&logger)
{
_writeMutex.lock();

if (level == Logger::Level::Clear)
{
logger.SetOutputFile(__logFileName);
return;
}

_writeMutex.lock();
if (file.find("/") != std::string::npos)
logger._file = file.substr(file.find_last_of("/") + 1, file.length() - 1);
else if (file.find("\\") != std::string::npos)
Expand Down
2 changes: 1 addition & 1 deletion cJass2Lua/Logger.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ namespace _____LOGGER
{
private:
Logger* _logger;
static std::mutex _writeMutex;
static std::recursive_mutex _writeMutex;

Writer(const Writer&) = delete;
Writer& operator=(const Writer&) = delete;
Expand Down
7 changes: 7 additions & 0 deletions cJass2Lua/OutputInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ OutputInterface::OutputInterface(Type type, NewLineType nlType, std::string& fil
case Type::String:
_strPtr = &fileNameOrString;
break;

case Type::FileAndConsole:
case Type::File:
hFile = CreateFileA(fileNameOrString.c_str(), GENERIC_WRITE, FILE_SHARE_READ, NULL,
CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_WRITE_THROUGH, NULL);
Expand Down Expand Up @@ -89,6 +91,11 @@ void OutputInterface::_toOutput(const std::string& str)
case Type::File:
WriteFile(*_file, &str[0], DWORD(str.length()), &dw, NULL);
break;

case Type::FileAndConsole:
std::cout << str;
WriteFile(*_file, &str[0], DWORD(str.length()), &dw, NULL);
break;
}
}

Expand Down
1 change: 1 addition & 0 deletions cJass2Lua/OutputInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class OutputInterface
None,
File,
Console,
FileAndConsole,
String
};

Expand Down
22 changes: 22 additions & 0 deletions cJass2Lua/cJass2Lua.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="*"
name="CompanyName.ProductName.YourApplication"
type="win32"
/>
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
3 changes: 3 additions & 0 deletions cJass2Lua/cJass2Lua.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@
<ItemGroup>
<Image Include="D:\Downloads\main.ico" />
</ItemGroup>
<ItemGroup>
<Manifest Include="cJass2Lua.manifest" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
Expand Down
3 changes: 3 additions & 0 deletions cJass2Lua/cJass2Lua.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,7 @@
<Filter>Файлы ресурсов</Filter>
</Image>
</ItemGroup>
<ItemGroup>
<Manifest Include="cJass2Lua.manifest" />
</ItemGroup>
</Project>
Loading

0 comments on commit 85a4d3a

Please sign in to comment.