Kaydet (Commit) e1fee5ae authored tarafından Eike Rathke's avatar Eike Rathke

TableRef: scan whatever (translated) item name up to the next ']' closer

Change-Id: Ifd18e4dd369a0fbe98da7a7b972c012f5269af3e
üst 040cf119
...@@ -89,6 +89,7 @@ enum ScanState ...@@ -89,6 +89,7 @@ enum ScanState
ssGetReference, ssGetReference,
ssSkipReference, ssSkipReference,
ssGetErrorConstant, ssGetErrorConstant,
ssGetTableRefItem,
ssStop ssStop
}; };
...@@ -1985,7 +1986,10 @@ Label_MaskStateMachine: ...@@ -1985,7 +1986,10 @@ Label_MaskStateMachine:
else if( nMask & SC_COMPILER_C_CHAR_ERRCONST ) else if( nMask & SC_COMPILER_C_CHAR_ERRCONST )
{ {
*pSym++ = c; *pSym++ = c;
eState = ssGetErrorConstant; if (!maTableRefs.empty() && maTableRefs.back().mnLevel)
eState = ssGetTableRefItem;
else
eState = ssGetErrorConstant;
} }
else if( nMask & SC_COMPILER_C_CHAR_DONTCARE ) else if( nMask & SC_COMPILER_C_CHAR_DONTCARE )
{ {
...@@ -2188,6 +2192,26 @@ Label_MaskStateMachine: ...@@ -2188,6 +2192,26 @@ Label_MaskStateMachine:
} }
} }
break; break;
case ssGetTableRefItem:
{
// Scan whatever up to the next ']' closer.
if (c != ']')
{
if( pSym == &cSymbol[ MAXSTRLEN-1 ] )
{
SetError( errStringOverflow);
eState = ssStop;
}
else
*pSym++ = c;
}
else
{
--pSrc;
eState = ssStop;
}
}
break;
case ssGetReference: case ssGetReference:
if( pSym == &cSymbol[ MAXSTRLEN-1 ] ) if( pSym == &cSymbol[ MAXSTRLEN-1 ] )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment