Fixed appending two variables
This commit is contained in:
parent
34ecfc0f46
commit
5ebdb9fc06
@ -134,6 +134,13 @@ namespace Assignment_1
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region Function Handling
|
#region Function Handling
|
||||||
|
/// <summary>
|
||||||
|
/// Handles the append x y case.
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="source"></param>
|
||||||
|
/// <param name="lineStart"></param>
|
||||||
|
/// <returns></returns>
|
||||||
bool Append(Stream source, long lineStart = -1)
|
bool Append(Stream source, long lineStart = -1)
|
||||||
{
|
{
|
||||||
// If it wasn't explicitly set, assume line starts the length of 'append ' before the current position
|
// If it wasn't explicitly set, assume line starts the length of 'append ' before the current position
|
||||||
@ -390,7 +397,6 @@ namespace Assignment_1
|
|||||||
{
|
{
|
||||||
s.Position--;
|
s.Position--;
|
||||||
string keyValue;
|
string keyValue;
|
||||||
|
|
||||||
long t = FindExistingIdentifier(s, out keyValue);
|
long t = FindExistingIdentifier(s, out keyValue);
|
||||||
|
|
||||||
if (!Symbols.ContainsKey(keyValue))
|
if (!Symbols.ContainsKey(keyValue))
|
||||||
@ -413,6 +419,12 @@ namespace Assignment_1
|
|||||||
{
|
{
|
||||||
string identifier;
|
string identifier;
|
||||||
long wordEnd = FindNextWord(s, out identifier);
|
long wordEnd = FindNextWord(s, out identifier);
|
||||||
|
if (identifier.EndsWith(';') && identifier.Length > 1)
|
||||||
|
{
|
||||||
|
// Remove the trailing semicolon from the parse & backtrack the identifier length one spot
|
||||||
|
identifier = identifier.TrimEnd(';');
|
||||||
|
wordEnd--;
|
||||||
|
}
|
||||||
// Lookup the value in the symbol table
|
// Lookup the value in the symbol table
|
||||||
returnedKey = identifier;
|
returnedKey = identifier;
|
||||||
return wordEnd;
|
return wordEnd;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user