}
}
}
- else if(isalpha(ch))
+ else if(isalpha(ch) || ch == '_')
{
if(eCON)
{
{
char buffer[256];
int c = 0;
- while(c < sizeof(buffer)-1 && isalpha(ch))
+ while(c < sizeof(buffer)-1 && (isalpha(ch) || isdigit(ch) || ch == '_'))
{
buffer[c++] = ch;
if(!f.Getc(&ch)) break;
break;
}
}
- else if(ch == '\"' || (!comment && ch && !isalpha(ch)))
+ else if(ch == '\"' || (!quoted && !comment && ch && !isalpha(ch) && !isdigit(ch) && ch != '_'))
{
if(quoted && ch == '\"' && wasQuoted)
*wasQuoted = true;
*string = CopyString(buffer.array);
}
delete buffer;
- if(ch != ',' && ch != '}' && ch != ';' && ch != '/' && ch != '=')
+ if(ch != ',' && ch != '}' && ch != ';' && ch != '/' && ch != '=' && ch != ':')
ch = 0;
return result;
}
lineComment = false;
else if(comment && pch == '*' && ch == '/')
comment = false;
- else if(ch == '=' || ch == ';' || ch == ',' || ch == '}')
+ else if(ch == '=' || ch == ':' || ch == ';' || ch == ',' || ch == ']' || ch == '}')
{
ch = 0;
seekback = -1;
{
SkipEmpty();
prop = null; member = null;
- if(ch == '=')
+ if(ch == '=' || ch == ':')
{
+ if(wasQuoted)
+ string[0] = (char)tolower(string[0]);
while(1)
{
eClass_FindNextMember(objectType, &curClass, &curMember, subMemberStack, &subMemberStackPos);
}
else
{
- if(ch == '=')
+ if(ch == '=' || ch == ':')
PrintLn("Warning: member ", string, " not found in class ", (String)objectType.name);
else
PrintLn("Warning: default member assignment: no more members");
ch = 0;
SkipEmpty();
}
- if(eCON && ch != '=')
+ if(eCON && ch != '=' && ch != ':')
{
f.Seek(seek-1, start);
ch = 0;
}
- if(ch == (eCON ? '=' : ':') || (eCON && type && (prop || member)))
+ if((ch == ':' || (eCON && ch == '=')) || (eCON && type && (prop || member)))
{
JSONResult itemResult = GetValue(type, value);
if(itemResult != syntaxError)