Fixed prefab tool for Linux

This commit is contained in:
2023-03-31 08:58:09 -07:00
parent c0a74bf52f
commit 5369e2e58a
2 changed files with 2 additions and 3 deletions

View File

@ -3,7 +3,6 @@
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "PrefabComponentParser.hpp"
using namespace Dawn;

View File

@ -64,7 +64,7 @@ struct PrefabComponentParserRuleset PrefabRegistry::getRuleset(std::string type)
// Find each instance of "@optional" when it's used within a comment
// e.g. // @optional or /* @optional */ in the string data.
std::regex regex("^\\s*(?:\\/\\/|\\/\\*){1}\\s*\\@optional\\s*(?:\\*\\/)?\\s*$", std::regex_constants::ECMAScript);
std::regex regex("^\\s*(?:\\/\\/|\\/\\*){1}\\s*\\@optional\\s*(?:\\*\\/)?\\s*$", std::regex_constants::ECMAScript | std::regex_constants::multiline);
std::sregex_iterator it(data.begin(), data.end(), regex);
std::sregex_iterator end;
while(it != end) {
@ -92,7 +92,7 @@ struct PrefabComponentParserRuleset PrefabRegistry::getRuleset(std::string type)
auto variableString = data.substr(varStart, varLength);
// Now (should) be able to extract the type;
std::regex regex2("^\\s*(?:[\\S]+<)?([\\w*:_\\s]+)(?:[\\S]+)? (\\**[\\w]+)\\s*$", std::regex_constants::ECMAScript);
std::regex regex2("^\\s*(?:[\\S]+<)?([\\w*:_\\s]+)(?:[\\S]+)? (\\**[\\w]+)\\s*$", std::regex_constants::ECMAScript | std::regex_constants::multiline);
std::smatch match;
if(!std::regex_search(variableString, match, regex2)) {
std::cout << "Failed to extract type and name from variable string! " << variableString << std::endl;