@@ -1420,7 +1420,6 @@ namespace attributes {
1420
1420
1421
1421
// Establish the text to parse for the signature
1422
1422
std::string signature = parseSignature (lineNumber);
1423
- std::cerr << " -------------------------------- SourceFileAttributesParser::parseFunction 10" << std::endl << signature << std::endl;
1424
1423
if (signature.empty ()) {
1425
1424
rcppExportNoFunctionFoundWarning (lineNumber); // #nocov
1426
1425
return Function (); // #nocov
@@ -1430,7 +1429,6 @@ namespace attributes {
1430
1429
// (bail with an empty result if we can't find them)
1431
1430
std::string::size_type endParenLoc = signature.find_last_of (' )' );
1432
1431
std::string::size_type beginParenLoc = signature.find_first_of (' (' );
1433
- std::cerr << " -------------------------------- SourceFileAttributesParser::parseFunction 20" << std::endl << beginParenLoc << std::endl << endParenLoc << std::endl;
1434
1432
if (endParenLoc == std::string::npos ||
1435
1433
beginParenLoc == std::string::npos ||
1436
1434
endParenLoc < beginParenLoc) {
@@ -1484,7 +1482,6 @@ namespace attributes {
1484
1482
endParenLoc-beginParenLoc-1 );
1485
1483
std::vector<std::string> args = parseArguments (argsText);
1486
1484
for (auto arg: args)
1487
- std::cerr << " -------------------------------- SourceFileAttributesParser::parseFunction 30" << std::endl << arg << std::endl;
1488
1485
for (std::vector<std::string>::const_iterator it =
1489
1486
args.begin (); it != args.end (); ++it) {
1490
1487
@@ -1592,14 +1589,13 @@ namespace attributes {
1592
1589
std::vector<std::string> SourceFileAttributesParser::parseArguments (
1593
1590
const std::string& argText) {
1594
1591
1595
- std::cerr << " -------------------------------- SourceFileAttributesParser::SourceFileAttributesParser::parseArguments 1" << std::endl << argText << std::endl;
1596
1592
int templateCount = 0 ;
1597
1593
int parenCount = 0 ;
1598
1594
bool endOfArg = false ;
1599
1595
std::string currentArg;
1600
1596
std::vector<std::string> args;
1601
1597
char quote = 0 ;
1602
- char prevChar = 0 ;
1598
+ bool escaped = false ;
1603
1599
typedef std::string::const_iterator it_t ;
1604
1600
for (it_t it = argText.begin (); it != argText.end (); ++it) {
1605
1601
@@ -1611,10 +1607,15 @@ namespace attributes {
1611
1607
// Ignore quoted strings and character values in single quotes
1612
1608
if ( ! quote && (ch == ' "' || ch == ' \' ' ))
1613
1609
quote = ch;
1614
- else if (quote && ch == quote && prevChar != ' \\ ' )
1610
+ else if (quote && ch == quote && ! escaped )
1615
1611
quote = 0 ;
1616
1612
1617
- std::cerr << " -------------------------------- SourceFileAttributesParser::SourceFileAttributesParser::parseArguments 10" << std::endl << " '" << prevChar << " ' '" << ch << " ' #" << quote << " #" << std::endl;
1613
+ // Escaped character inside quotes
1614
+ if (escaped)
1615
+ escaped = false ;
1616
+ else if (quote && ch == ' \\ ' )
1617
+ escaped = true ;
1618
+
1618
1619
// Detect end of argument declaration
1619
1620
if ( ! quote &&
1620
1621
(ch == ' ,' ) &&
@@ -1625,7 +1626,6 @@ namespace attributes {
1625
1626
endOfArg = true ;
1626
1627
}
1627
1628
1628
- std::cerr << " -------------------------------- SourceFileAttributesParser::SourceFileAttributesParser::parseArguments 20" << std::endl << endOfArg << std::endl;
1629
1629
if ( ! endOfArg) {
1630
1630
1631
1631
// Append current character if not a space at start
@@ -1650,10 +1650,6 @@ namespace attributes {
1650
1650
}
1651
1651
}
1652
1652
}
1653
- std::cerr << " -------------------------------- SourceFileAttributesParser::SourceFileAttributesParser::parseArguments 30" << std::endl << templateCount << " " << parenCount << std::endl;
1654
- std::cerr << " -------------------------------- SourceFileAttributesParser::SourceFileAttributesParser::parseArguments 40" << std::endl << currentArg << std::endl;
1655
-
1656
- prevChar = ch;
1657
1653
}
1658
1654
1659
1655
if (!currentArg.empty ())
0 commit comments