Skip to content

Conversation

@jjtolton
Copy link

Summary

Fixes #3140

The parser was incorrectly accepting (|) and converting it to the atom '|', when it should produce a syntax_error according to ISO/IEC 13211-1 Technical Corrigendum 2, Section C2.

Changes

  • Modified reduce_brackets() in parser.rs to reject HeadTailSeparator inside parentheses, treating (|) as incomplete/forbidden syntax
  • Updated builtins.pl to use quoted atom '|' instead of (|) in error term
  • Added comprehensive tests in src/tests/iso_syntax_errors.pl covering:
    • (|) syntax error
    • ISO operator creation restrictions for {} and '|'
    • Valid operator declarations with proper priorities

Test Results

All tests pass including the new ISO syntax error tests.

Reference

Fixes mthom#3140 The parser was incorrectly accepting (|) and converting it to the atom '|', when it should produce a syntax_error according to ISO/IEC 13211-1 Technical Corrigendum 2, Section C2. Changes: - Modified reduce_brackets() in parser.rs to reject HeadTailSeparator inside parentheses, treating (|) as incomplete/forbidden syntax - Updated builtins.pl to use quoted atom '|' instead of (|) in error term - Added comprehensive tests in src/tests/iso_syntax_errors.pl covering: * (|) syntax error * ISO operator creation restrictions for {} and '|' * Valid operator declarations with proper priorities
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant