Skip to content

Commit

Permalink
Merge branch 'hotfix/v1.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
arBmind committed Nov 27, 2014
2 parents 8ddffda + a9101fe commit a8cd567
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 21 deletions.
4 changes: 4 additions & 0 deletions 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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -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
Expand All @@ -63,7 +63,7 @@ function methodArgs(args) {
\#{', '}
}
// use backslash to avoid linebreaks
\arg
\#{arg}
});
}
function showMethod(method) {
Expand Down
2 changes: 1 addition & 1 deletion example/BasicUsage/main.cpp
Expand Up @@ -29,7 +29,7 @@ function methodArgs(args) {
\#{', '}
}
// use backslash to avoid linebreaks
\arg
\#{arg}
});
}
function showMethod(method) {
Expand Down
2 changes: 1 addition & 1 deletion src/Twofold/Engine.cpp
Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions src/Twofold/PathTextFileLoader.cpp
Expand Up @@ -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
Expand All @@ -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
10 changes: 5 additions & 5 deletions src/Twofold/PreparedTemplateBuilder.cpp
Expand Up @@ -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())
{}

Expand Down Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions src/Twofold/intern/Command/Include.cpp
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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)
{
Expand Down
5 changes: 2 additions & 3 deletions src/Twofold/intern/Command/Include.h
Expand Up @@ -30,7 +30,6 @@
namespace Twofold {
namespace intern {

class LineProcessor;
class PreparedJavascriptBuilder;
struct LineCommand;

Expand All @@ -49,8 +48,8 @@ class Include
using ProcessIncludedTextFunction = std::function<void(const QString &name, const QString &text)> ;
using Stack = std::vector<QString>;

Include(const MessageHandlerPtr &m_messageHandler,
const TextLoaderPtr &m_textLoader,
Include(const MessageHandlerPtr &messageHandler,
const TextLoaderPtr &textLoader,
PreparedJavascriptBuilder &builder,
const ProcessIncludedTextFunction &processIncludeText);

Expand Down
2 changes: 1 addition & 1 deletion vendor/SourceMap.pro
Expand Up @@ -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

0 comments on commit a8cd567

Please sign in to comment.