Skip to content

Commit

Permalink
Merge pull request #37 from ange-yaghi/feature/I36_escaped_characters…
Browse files Browse the repository at this point in the history
…_issue

Feature/i36 escaped characters issue
  • Loading branch information
ange-yaghi authored Aug 20, 2019
2 parents 52ac8de + 095f53e commit b865dbd
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 0 additions & 4 deletions include/conf.h

This file was deleted.

10 changes: 4 additions & 6 deletions include/ir_value_constant.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ namespace piranha {

protected:
virtual void _validate() {
m_value = validateData(m_value);
m_value = validateData(m_value, true);
}

template <typename _T>
const _T validateData(const _T &data) { return data; }
const _T validateData(const _T &data, bool recordErrors = false) { return data; }

template <>
const piranha::native_string validateData<piranha::native_string>(const piranha::native_string &data) {
const piranha::native_string validateData<piranha::native_string>(const piranha::native_string &data, bool recordErrors) {
piranha::native_string res;
piranha::native_string::const_iterator it = data.begin();
while (it != data.end()) {
Expand Down Expand Up @@ -99,7 +99,6 @@ namespace piranha {

if (builtinType.empty()) {
// TODO: raise error, literal not supported
int a = 0;
}

int count = 0;
Expand All @@ -108,15 +107,14 @@ namespace piranha {

if (nodeDefinition == nullptr) {
// TODO: raise error, literal type not defined or not available
int a = 0;
}

// Generate the expansion
IrAttributeList *attributeList = new IrAttributeList();

IrLiteralNode<T> *expansion = new IrLiteralNode<T>();
expansion->setName("\"" + Base::valueToString() + "\"");
expansion->setLiteralData(Base::m_value);
expansion->setLiteralData(Base::template validateData<T>(Base::m_value));
expansion->setAttributes(attributeList);
expansion->setLogicalParent(this);
expansion->setScopeParent(this);
Expand Down
6 changes: 6 additions & 0 deletions include/version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef PIRANHA_VERSION_H
#define PIRANHA_VERSION_H

#define PIRANHA_VERSION "v0.0.4a"

#endif /* PIRANHA_VERSION_H */
2 changes: 1 addition & 1 deletion project/piranha/piranha.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ py $(ProjectDir)\..\..\scripts\package_piranha.py $(PlatformTarget) $(Configura
<ClInclude Include="..\..\include\ir_node.h" />
<ClInclude Include="..\..\include\ir_node_definition.h" />
<ClInclude Include="..\..\include\ir_parser_structure.h" />
<ClInclude Include="..\..\include\conf.h" />
<ClInclude Include="..\..\include\version.h" />
<ClInclude Include="..\..\include\scanner.h" />
<ClInclude Include="..\..\include\ir_structure_list.h" />
<ClInclude Include="..\..\include\ir_token_info.h" />
Expand Down
6 changes: 3 additions & 3 deletions project/piranha/piranha.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,6 @@
<ClInclude Include="..\..\include\ir_compilation_unit.h">
<Filter>Header Files\syntax\unit</Filter>
</ClInclude>
<ClInclude Include="..\..\include\conf.h">
<Filter>Header Files\configuration</Filter>
</ClInclude>
<ClInclude Include="..\..\include\ir_context_tree.h">
<Filter>Header Files\syntax\parser</Filter>
</ClInclude>
Expand Down Expand Up @@ -348,6 +345,9 @@
<ClInclude Include="..\..\include\throw_runtime_error_node.h">
<Filter>Header Files\nodes\probes</Filter>
</ClInclude>
<ClInclude Include="..\..\include\version.h">
<Filter>Header Files\configuration</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\src\node_output.cpp">
Expand Down

0 comments on commit b865dbd

Please sign in to comment.