Skip to content

Conversation

@takeyaqa
Copy link

@takeyaqa takeyaqa commented Feb 9, 2026

Summary

The constraints grammar in doc/pict.md is missing a few productions that are supported by the implementation in cli/ctokenizer.cpp.

  • IF ... THEN ...; (without ELSE): The grammar only lists IF Predicate THEN Predicate ELSE Predicate; but ELSE is optional in the implementation (parseConstraint()). The document's own examples also use this form, e.g. IF [File system] = "FAT" THEN [Size] <= 4096;

    • ref:

      pict/cli/ctokenizer.cpp

      Lines 148 to 157 in c3dad2b

      // evaluate the ELSE part
      skipWhiteChars();
      position = _currentPosition;
      if ( isNextSubstring( charArrToStr( TEXT_TokenKeywordElse )))
      {
      CToken* tokenKeywordElse = new CToken( TokenType::KeywordElse, position );
      tokens.push_back( tokenKeywordElse );
      parseClause( tokens );
      }
  • NOT IN / NOT LIKE: getRelationType() handles these as compound relation operators, but they are not listed in the grammar.

    • ref:

      pict/cli/ctokenizer.cpp

      Lines 528 to 533 in c3dad2b

      {
      skipWhiteChars();
      if ( isNextSubstring( charArrToStr( TEXT_TokenRelationIN ))) return ( RelationType::NotIn );
      else if( isNextSubstring( charArrToStr( TEXT_TokenRelationLIKE ))) return ( RelationType::NotLike );
      else throw CSyntaxError( SyntaxErrorType::UnknownRelation, _currentPosition );
      }

No behavioral changes. Documentation only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant