This commit is contained in:
Hackerpilot 2016-02-25 14:02:12 -08:00
parent 19801d4796
commit 65ac0871fd
5 changed files with 75 additions and 6 deletions

View File

@ -1038,7 +1038,6 @@ private:
writeToken();
break;
}
else
goto case;
case tok!"&":
case tok!"+":
@ -1106,6 +1105,7 @@ private:
break;
case tok!"&&":
case tok!"||":
case tok!"|":
regenLineBreakHintsIfNecessary(index);
goto case;
case tok!"=":
@ -1134,7 +1134,6 @@ private:
case tok!">>>":
case tok!">>":
case tok!">":
case tok!"|":
case tok!"!<=":
case tok!"!<>=":
case tok!"!<>":

View File

@ -161,11 +161,12 @@ size_t[] chooseLineBreakTokens(size_t index, const Token[] tokens,
validMoves!(typeof(open))(open, tokens[0 .. tokensEnd], depths[0 .. tokensEnd],
current.breaks, config, currentLineLength, indentLevel);
}
if (open.empty)
return genRetVal(lowest.breaks, index);
foreach (r; open[].filter!(a => a.solved))
return genRetVal(r.breaks, index);
assert(false);
if (open[].front < lowest)
return genRetVal(open[].front.breaks, index);
else
return genRetVal(lowest.breaks, index);
}
void validMoves(OR)(auto ref OR output, const Token[] tokens, immutable short[] depths,

View File

@ -0,0 +1,24 @@
enum
{
SQL_CA2_READ_ONLY_CONCURRENCY = 0x00000001L,
SQL_CA2_LOCK_CONCURRENCY = 0x00000002L,
SQL_CA2_OPT_ROWVER_CONCURRENCY = 0x00000004L,
SQL_CA2_OPT_VALUES_CONCURRENCY = 0x00000008L,
SQL_CA2_SENSITIVITY_ADDITIONS = 0x00000010L,
SQL_CA2_SENSITIVITY_DELETIONS = 0x00000020L,
SQL_CA2_SENSITIVITY_UPDATES = 0x00000040L,
// * semantics of SQL_ATTR_MAX_ROWS *
SQL_CA2_MAX_ROWS_SELECT = 0x00000080L,
SQL_CA2_MAX_ROWS_INSERT = 0x00000100L,
SQL_CA2_MAX_ROWS_DELETE = 0x00000200L,
SQL_CA2_MAX_ROWS_UPDATE = 0x00000400L,
SQL_CA2_MAX_ROWS_CATALOG = 0x00000800L,
SQL_CA2_MAX_ROWS_AFFECTS_ALL = (
SQL_CA2_MAX_ROWS_SELECT | SQL_CA2_MAX_ROWS_INSERT | SQL_CA2_MAX_ROWS_DELETE
| SQL_CA2_MAX_ROWS_UPDATE | SQL_CA2_MAX_ROWS_CATALOG),
SQL_CA2_CRC_EXACT = 0x00001000L,
SQL_CA2_CRC_APPROXIMATE = 0x00002000L,
SQL_CA2_SIMULATE_NON_UNIQUE = 0x00004000L,
SQL_CA2_SIMULATE_TRY_UNIQUE = 0x00008000L,
SQL_CA2_SIMULATE_UNIQUE = 0x00010000L
}

22
tests/issue0229.d Normal file
View File

@ -0,0 +1,22 @@
enum
{
SQL_CA2_READ_ONLY_CONCURRENCY = 0x00000001L,
SQL_CA2_LOCK_CONCURRENCY = 0x00000002L,
SQL_CA2_OPT_ROWVER_CONCURRENCY = 0x00000004L,
SQL_CA2_OPT_VALUES_CONCURRENCY = 0x00000008L,
SQL_CA2_SENSITIVITY_ADDITIONS = 0x00000010L,
SQL_CA2_SENSITIVITY_DELETIONS = 0x00000020L,
SQL_CA2_SENSITIVITY_UPDATES = 0x00000040L,
// * semantics of SQL_ATTR_MAX_ROWS *
SQL_CA2_MAX_ROWS_SELECT = 0x00000080L,
SQL_CA2_MAX_ROWS_INSERT = 0x00000100L,
SQL_CA2_MAX_ROWS_DELETE = 0x00000200L,
SQL_CA2_MAX_ROWS_UPDATE = 0x00000400L,
SQL_CA2_MAX_ROWS_CATALOG = 0x00000800L,
SQL_CA2_MAX_ROWS_AFFECTS_ALL = (SQL_CA2_MAX_ROWS_SELECT | SQL_CA2_MAX_ROWS_INSERT | SQL_CA2_MAX_ROWS_DELETE | SQL_CA2_MAX_ROWS_UPDATE | SQL_CA2_MAX_ROWS_CATALOG),
SQL_CA2_CRC_EXACT = 0x00001000L,
SQL_CA2_CRC_APPROXIMATE = 0x00002000L,
SQL_CA2_SIMULATE_NON_UNIQUE = 0x00004000L,
SQL_CA2_SIMULATE_TRY_UNIQUE = 0x00008000L,
SQL_CA2_SIMULATE_UNIQUE = 0x00010000L
}

View File

@ -0,0 +1,23 @@
enum {
SQL_CA2_READ_ONLY_CONCURRENCY = 0x00000001L,
SQL_CA2_LOCK_CONCURRENCY = 0x00000002L,
SQL_CA2_OPT_ROWVER_CONCURRENCY = 0x00000004L,
SQL_CA2_OPT_VALUES_CONCURRENCY = 0x00000008L,
SQL_CA2_SENSITIVITY_ADDITIONS = 0x00000010L,
SQL_CA2_SENSITIVITY_DELETIONS = 0x00000020L,
SQL_CA2_SENSITIVITY_UPDATES = 0x00000040L,
// * semantics of SQL_ATTR_MAX_ROWS *
SQL_CA2_MAX_ROWS_SELECT = 0x00000080L,
SQL_CA2_MAX_ROWS_INSERT = 0x00000100L,
SQL_CA2_MAX_ROWS_DELETE = 0x00000200L,
SQL_CA2_MAX_ROWS_UPDATE = 0x00000400L,
SQL_CA2_MAX_ROWS_CATALOG = 0x00000800L,
SQL_CA2_MAX_ROWS_AFFECTS_ALL = (
SQL_CA2_MAX_ROWS_SELECT | SQL_CA2_MAX_ROWS_INSERT | SQL_CA2_MAX_ROWS_DELETE
| SQL_CA2_MAX_ROWS_UPDATE | SQL_CA2_MAX_ROWS_CATALOG),
SQL_CA2_CRC_EXACT = 0x00001000L,
SQL_CA2_CRC_APPROXIMATE = 0x00002000L,
SQL_CA2_SIMULATE_NON_UNIQUE = 0x00004000L,
SQL_CA2_SIMULATE_TRY_UNIQUE = 0x00008000L,
SQL_CA2_SIMULATE_UNIQUE = 0x00010000L
}