- // Next we do some common symbols where the first character commits us to things that cannot possibly be a move
- // (but not {} comments, as those force time-consuming matching of PGN results immediately after it)
-
- // ********* PGN tags ******************************************
- if(**p == '[') {
- oldp = ++(*p);
- if(Match("--", p)) { // "[--" could be start of position diagram
- if(!Scan(']', p) && (*p)[-3] == '-' && (*p)[-2] == '-') return PositionDiagram;
- *p = oldp;
- }
- SkipWhite(p);
- if(isdigit(**p) || isalpha(**p)) {
- do (*p)++; while(isdigit(**p) || isalpha(**p) || **p == '+' ||
- **p == '-' || **p == '=' || **p == '_' || **p == '#');
- SkipWhite(p);
- if(*(*p)++ == '"') {
- while(**p != '\n' && (*(*p)++ != '"'|| (*p)[-2] == '\\')); // look for unescaped quote
- if((*p)[-1] !='"') { *p = oldp; Scan(']', p); return Comment; } // string closing delimiter missing
- SkipWhite(p); if(*(*p)++ == ']') return PGNTag;
- }
- }
- Scan(']', p); return Comment;
- }
-
-
- // ********* variations (nesting) ******************************
- if(**p =='(') {
- if(RdTime(')', p)) return ElapsedTime;
- return Open;
- }
- if(**p ==')') { (*p)++; return Close; }
- if(**p == ';') { while(**p != '\n') (*p)++; return Comment; }
-