Skip to content
This repository has been archived by the owner on Oct 1, 2018. It is now read-only.

Commit

Permalink
fix: escaped property name
Browse files Browse the repository at this point in the history
  • Loading branch information
w-vi committed Dec 5, 2016
1 parent dbdbacb commit 0d6a171
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/MSONUtility.h
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ namespace mson {
parseTypeDefinition(node, pd, signature.attributes, report, propertyName.variable.typeDefinition);
}
else {
propertyName.literal = subject;
propertyName.literal = snowcrash::StripBackticks(buffer);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/SignatureSectionProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ namespace scpl {
snowcrash::TrimString(identifier);

if (!identifier.empty()) {
out.identifier = snowcrash::StripBackticks(identifier);
out.identifier = identifier;
}

// If the subject ended with the identifier, strip it from the subject
Expand Down
6 changes: 3 additions & 3 deletions test/test-Signature.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ TEST_CASE("Escaped property signature parsing", "[signature]")
REQUIRE(blueprint.report.error.code == Error::OK);
REQUIRE(blueprint.report.warnings.empty());

REQUIRE(signature.identifier == "*id*(data):3");
REQUIRE(signature.identifier == "`*id*(data):3`");
REQUIRE(signature.value == "42");
REQUIRE(signature.values.size() == 1);
REQUIRE(signature.values[0] == "`42`");
Expand Down Expand Up @@ -138,7 +138,7 @@ TEST_CASE("Identifier enclosed by backticks", "[signature]")
REQUIRE(blueprint.report.error.code == Error::OK);
REQUIRE(blueprint.report.warnings.empty());

REQUIRE(signature.identifier == "username `is` g``ood");
REQUIRE(signature.identifier == "```username `is` g``ood```");
REQUIRE(signature.value.empty());
REQUIRE(signature.values.empty());
REQUIRE(signature.attributes.size() == 1);
Expand Down Expand Up @@ -172,7 +172,7 @@ TEST_CASE("Extra space content after identifier enclosure", "[signature]")
REQUIRE(blueprint.report.error.code == Error::OK);
REQUIRE(blueprint.report.warnings.empty());

REQUIRE(signature.identifier == "a");
REQUIRE(signature.identifier == "`a`");
REQUIRE(signature.value == "42");
REQUIRE(signature.values.size() == 1);
REQUIRE(signature.values[0] == "42");
Expand Down

0 comments on commit 0d6a171

Please sign in to comment.