diff options
author | Thomas White <taw@physics.org> | 2019-02-18 17:07:08 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2019-03-11 16:49:37 +0100 |
commit | 830868c3edd603fc2466248ed363066f312c9ac8 (patch) | |
tree | ea1ee2945610a89c799c184a4d84e04a41625b0b /libcrystfel/src/symop.y | |
parent | a2f4977e0f8bd9becd50ab5a2ef903038273133c (diff) |
Better handling of multiple symop error
Diffstat (limited to 'libcrystfel/src/symop.y')
-rw-r--r-- | libcrystfel/src/symop.y | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libcrystfel/src/symop.y b/libcrystfel/src/symop.y index a304ea37..bebf823f 100644 --- a/libcrystfel/src/symop.y +++ b/libcrystfel/src/symop.y @@ -70,10 +70,13 @@ %type <r> fraction %{ -static int try_add_symop(SymOpList *list, RationalMatrix *m) +static int try_add_symop(SymOpList *list, RationalMatrix *m, int complain) { if ( list == NULL ) { - yyerror(m, list, "Must be a single symmetry operation"); + /* Only complain if this isn't the only operation provided */ + if ( complain ) { + yyerror(m, list, "Must be a single symmetry operation"); + } return 1; } else { IntegerMatrix *im; @@ -92,8 +95,8 @@ static int try_add_symop(SymOpList *list, RationalMatrix *m) %% symoplist: - symop { if ( try_add_symop(list, m) ) YYERROR; } -| symoplist SEMICOLON symop { if ( try_add_symop(list, m) ) YYERROR; } + symop { try_add_symop(list, m, 0); } +| symoplist SEMICOLON symop { if ( try_add_symop(list, m, 1) ) YYERROR; } ; symop: |