diff --git a/CHANGES b/CHANGES index c2fc384..501d5bc 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ +Changes for 1.0.1 (released 2014-11-27): + * fixed Linux build + * code style improvements + Changes for 1.0.0 (released 2014-11-27): * Initial Open Source release * Builtin SourceMap with Caller & Interpolation extensions diff --git a/README.md b/README.md index d0bf80d..7a2e683 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Twofold is basically Javascript that is extended with constructs to generate sou ```twofold \ indented output #{interpolated} without a line break - | intendet output #{interpolated} with a line break + | indented output #{interpolated} with a line break # include "indent_the_included_file.twofold" = change_indentation_of_javascript() // every line is regular javascript @@ -63,7 +63,7 @@ function methodArgs(args) { \#{', '} } // use backslash to avoid linebreaks - \arg + \#{arg} }); } function showMethod(method) { diff --git a/example/BasicUsage/main.cpp b/example/BasicUsage/main.cpp index ad69974..986b1e7 100644 --- a/example/BasicUsage/main.cpp +++ b/example/BasicUsage/main.cpp @@ -29,7 +29,7 @@ function methodArgs(args) { \#{', '} } // use backslash to avoid linebreaks - \arg + \#{arg} }); } function showMethod(method) { diff --git a/src/Twofold/Engine.cpp b/src/Twofold/Engine.cpp index 4357d87..f6b1b97 100644 --- a/src/Twofold/Engine.cpp +++ b/src/Twofold/Engine.cpp @@ -80,7 +80,7 @@ class Engine::Private undefineInputs(inputs); const auto sourceMapText = scriptTargetBuilder.build(); - return Target { sourceMapText.sourceMap, sourceMapText.text }; + return { sourceMapText.sourceMap, sourceMapText.text }; } void showSyntaxError(QScriptSyntaxCheckResult checkResult, const PreparedTemplate &preparedTemplate) diff --git a/src/Twofold/PathTextFileLoader.cpp b/src/Twofold/PathTextFileLoader.cpp index d10b415..7846f3b 100644 --- a/src/Twofold/PathTextFileLoader.cpp +++ b/src/Twofold/PathTextFileLoader.cpp @@ -46,7 +46,7 @@ const QString PathTextFileLoader::absolutePath(const QString &name) const return fullPath; // readable path found } - return QString(); + return {}; } PathTextFileLoader::Result PathTextFileLoader::load(const QString &name) const @@ -63,9 +63,9 @@ PathTextFileLoader::Result PathTextFileLoader::load(const QString &name) const if (!file.isOpen()) continue; // file not readable, try next path - return Result { Success, fullPath, QTextStream(&file).readAll() }; + return { Success, fullPath, QTextStream(&file).readAll() }; } - return Result { candidate.isEmpty() ? NotFound : ErrorLoading, candidate, QString() }; + return { candidate.isEmpty() ? NotFound : ErrorLoading, candidate, QString() }; } } // namespace Twofold diff --git a/src/Twofold/PreparedTemplateBuilder.cpp b/src/Twofold/PreparedTemplateBuilder.cpp index c6d5a53..6f486cc 100644 --- a/src/Twofold/PreparedTemplateBuilder.cpp +++ b/src/Twofold/PreparedTemplateBuilder.cpp @@ -36,9 +36,9 @@ using namespace intern; class PreparedTemplateBuilder::Private { public: - Private(const MessageHandlerPtr &_messageHandler, const TextLoaderPtr &_textLoader) - : messageHandler(_messageHandler) - , textLoader(_textLoader) + Private(const MessageHandlerPtr &messageHandler, const TextLoaderPtr &textLoader) + : messageHandler(messageHandler) + , textLoader(textLoader) , lineProcessor(buildLineProcessor()) {} @@ -68,12 +68,12 @@ class PreparedTemplateBuilder::Private { const auto result = textLoader->load(name); if (result.status != TextLoader::Success) { - return PreparedTemplate { QString{}, SourceMapping{{}}, FileLineColumnPositionList{} }; // could not load + return { QString{}, SourceMapping{{}}, FileLineColumnPositionList{} }; // could not load } lineProcessor(result.name, result.text); const auto preparedJavascript = preparedJavascriptBuilder.build(); - return PreparedTemplate { preparedJavascript.javascript, preparedJavascript.sourceMap, preparedJavascript.originPositions }; + return { preparedJavascript.javascript, preparedJavascript.sourceMap, preparedJavascript.originPositions }; } const MessageHandlerPtr messageHandler; diff --git a/src/Twofold/intern/Command/Include.cpp b/src/Twofold/intern/Command/Include.cpp index 3b07aa5..64a0191 100644 --- a/src/Twofold/intern/Command/Include.cpp +++ b/src/Twofold/intern/Command/Include.cpp @@ -41,11 +41,11 @@ QString extractNameArgument(const LineCommand &command) { auto nameBegin = std::find_if(command.end, command.line.end, isDoubleQuote); if (nameBegin == command.line.end) - return QString(); // no initial double quote found + return {}; // no initial double quote found nameBegin++; auto nameEnd = std::find_if(nameBegin, command.line.end, isDoubleQuote); if (nameEnd == command.line.end) - return QString(); // no second double quote found + return {}; // no second double quote found return toQString(nameBegin, nameEnd); } @@ -105,9 +105,9 @@ struct StackEntry { } // namespace -Include::Include(const MessageHandlerPtr &m_messageHandler, const TextLoaderPtr &m_textLoader, PreparedJavascriptBuilder &builder, const ProcessIncludedTextFunction &processIncludeText) - : m_messageHandler(m_messageHandler) - , m_textLoader(m_textLoader) +Include::Include(const MessageHandlerPtr &messageHandler, const TextLoaderPtr &textLoader, PreparedJavascriptBuilder &builder, const ProcessIncludedTextFunction &processIncludeText) + : m_messageHandler(messageHandler) + , m_textLoader(textLoader) , m_builder(builder) , m_processIncludeText(processIncludeText) { diff --git a/src/Twofold/intern/Command/Include.h b/src/Twofold/intern/Command/Include.h index 7e80954..a7cd07b 100644 --- a/src/Twofold/intern/Command/Include.h +++ b/src/Twofold/intern/Command/Include.h @@ -30,7 +30,6 @@ namespace Twofold { namespace intern { -class LineProcessor; class PreparedJavascriptBuilder; struct LineCommand; @@ -49,8 +48,8 @@ class Include using ProcessIncludedTextFunction = std::function ; using Stack = std::vector; - Include(const MessageHandlerPtr &m_messageHandler, - const TextLoaderPtr &m_textLoader, + Include(const MessageHandlerPtr &messageHandler, + const TextLoaderPtr &textLoader, PreparedJavascriptBuilder &builder, const ProcessIncludedTextFunction &processIncludeText); diff --git a/vendor/SourceMap.pro b/vendor/SourceMap.pro index 053eb61..8c2135a 100644 --- a/vendor/SourceMap.pro +++ b/vendor/SourceMap.pro @@ -43,5 +43,5 @@ compiler_clean.commands = -$(DEL_FILE) $$shell_path($$TARGET_NAME/Makefile) prepareBuild.depends = makeBuildFolder buildInstall.depends = prepareBuild -install.depends = $(DESTDIR_TARGET) +install.depends = $(DESTDIR_TARGET) $(TARGET) QMAKE_EXTRA_TARGETS += makeBuildFolder prepareBuild buildInstall install compiler_clean