From 3c9882840e75d60b82aa26e6494e494d994279c3 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Tue, 6 May 2014 13:38:03 -0400 Subject: Revert "giscanner: don't accept (allow-none) on Returns:" This reverts commit 0839e696e9fbc1942ac5c61054de3b47e9578152. This was accidentally picked up by my 'git bz apply' against the bug as I was getting ready to push the last set of changes. --- giscanner/annotationparser.py | 2 +- .../annotationparser/gi/annotation_allow_none.xml | 9 +++++-- tests/scanner/annotationparser/gi/tag.xml | 29 +++++++++------------ tests/scanner/annotationparser/gi/tag_returns.xml | 30 +++++++++++----------- .../gtkdoc/annotations/tester.c.xml | 3 --- tests/scanner/regress.c | 2 +- 6 files changed, 36 insertions(+), 39 deletions(-) diff --git a/giscanner/annotationparser.py b/giscanner/annotationparser.py index a167ff94..ecbfdce6 100644 --- a/giscanner/annotationparser.py +++ b/giscanner/annotationparser.py @@ -981,7 +981,7 @@ class GtkDocTag(GtkDocAnnotatable): __slots__ = ('name', 'value', 'description') - valid_annotations = (ANN_ARRAY, ANN_ATTRIBUTES, ANN_ELEMENT_TYPE, ANN_SKIP, + valid_annotations = (ANN_ALLOW_NONE, ANN_ARRAY, ANN_ATTRIBUTES, ANN_ELEMENT_TYPE, ANN_SKIP, ANN_TRANSFER, ANN_TYPE) def __init__(self, name, position=None): diff --git a/tests/scanner/annotationparser/gi/annotation_allow_none.xml b/tests/scanner/annotationparser/gi/annotation_allow_none.xml index 877c60fd..ae6b3b37 100644 --- a/tests/scanner/annotationparser/gi/annotation_allow_none.xml +++ b/tests/scanner/annotationparser/gi/annotation_allow_none.xml @@ -10,7 +10,7 @@ * * This is a test for out arguments * - * Return value: an int + * Return value: (allow-none): an int */ @@ -39,6 +39,11 @@ returns + + + allow-none + + an int @@ -51,7 +56,7 @@ * * This is a test for out arguments * - * Returns: an int + * Returns: (allow-none): an int */ diff --git a/tests/scanner/annotationparser/gi/tag.xml b/tests/scanner/annotationparser/gi/tag.xml index a89b3ad8..8480d4b4 100644 --- a/tests/scanner/annotationparser/gi/tag.xml +++ b/tests/scanner/annotationparser/gi/tag.xml @@ -8,7 +8,7 @@ * * Forgotten colon below will result in a warning. * - * Returns: (transfer none) return value + * Returns: (allow-none) return value **/ @@ -21,12 +21,7 @@ returns - transfer - - - + allow-none return value @@ -34,9 +29,9 @@ - 6: Warning: Test: missing ":" at column 28: - * Returns: (transfer none) return value - ^ + 6: Warning: Test: missing ":" at column 25: + * Returns: (allow-none) return value + ^ /** @@ -44,7 +39,7 @@ * * Forgotten colon below will result in a warning. * - * Returns: (transfer none): return value + * Returns: (allow-none): return value */ @@ -176,7 +171,7 @@ Moo: anything * * Annotations spanning multiple lines are not valid * - * Returns: (skip) + * Returns: (allow-none) * (transfer full): something **/ @@ -190,7 +185,7 @@ Moo: anything returns - skip + allow-none @@ -209,7 +204,7 @@ Moo: anything * * Annotations spanning multiple lines are not valid * - * Returns: (skip): + * Returns: (allow-none): * (transfer full): something */ @@ -220,7 +215,7 @@ Moo: anything * * Annotations spanning multiple lines are not valid * - * Returns: (skip): Returns tag having a second line which looks + * Returns: (allow-none): Returns tag having a second line which looks * (like an annotation), but isn't. This should not result in a warning. **/ @@ -234,7 +229,7 @@ Moo: anything returns - skip + allow-none Returns tag having a second line which looks @@ -248,7 +243,7 @@ Moo: anything * * Annotations spanning multiple lines are not valid * - * Returns: (skip): Returns tag having a second line which looks + * Returns: (allow-none): Returns tag having a second line which looks * (like an annotation), but isn't. This should not result in a warning. */ diff --git a/tests/scanner/annotationparser/gi/tag_returns.xml b/tests/scanner/annotationparser/gi/tag_returns.xml index 49389c2c..8ccfaa63 100644 --- a/tests/scanner/annotationparser/gi/tag_returns.xml +++ b/tests/scanner/annotationparser/gi/tag_returns.xml @@ -8,7 +8,7 @@ * * Test returning a string as an out parameter * - * Returns: (skip): some boolean + * Returns: (allow-none): some boolean **/ @@ -21,7 +21,7 @@ returns - skip + allow-none some boolean @@ -34,7 +34,7 @@ * * Test returning a string as an out parameter * - * Returns: (skip): some boolean + * Returns: (allow-none): some boolean */ @@ -44,7 +44,7 @@ * * Test returning a string as an out parameter * - * Returns: (skip)): some boolean + * Returns: (allow-none)): some boolean **/ @@ -60,8 +60,8 @@ 6: Error: Test: unbalanced parentheses, annotations will be ignored: - * Returns: (skip)): some boolean - ^ + * Returns: (allow-none)): some boolean + ^ /** @@ -121,7 +121,7 @@ Tags should go after the comment block description * * Test returning a string as an out parameter * - * Return value: (skip): some boolean + * Return value: (allow-none): some boolean **/ @@ -134,7 +134,7 @@ Tags should go after the comment block description returns - skip + allow-none some boolean @@ -147,7 +147,7 @@ Tags should go after the comment block description * * Test returning a string as an out parameter * - * Returns: (skip): some boolean + * Returns: (allow-none): some boolean */ @@ -157,7 +157,7 @@ Tags should go after the comment block description --> /** * annotation_object_string_out: - * @returns: (skip): some boolean + * @returns: (allow-none): some boolean * * Test returning a string as an out parameter **/ @@ -172,7 +172,7 @@ Tags should go after the comment block description returns - skip + allow-none some boolean @@ -185,7 +185,7 @@ Tags should go after the comment block description * * Test returning a string as an out parameter * - * Returns: (skip): some boolean + * Returns: (allow-none): some boolean */ @@ -195,7 +195,7 @@ Tags should go after the comment block description --> /** * annotation_object_string_out: - * @returns: (skip)): some boolean + * @returns: (allow-none)): some boolean * * Test returning a string as an out parameter **/ @@ -213,8 +213,8 @@ Tags should go after the comment block description 3: Error: Test: unbalanced parentheses, annotations will be ignored: - * @returns: (skip)): some boolean - ^ + * @returns: (allow-none)): some boolean + ^ /** diff --git a/tests/scanner/annotationparser/gtkdoc/annotations/tester.c.xml b/tests/scanner/annotationparser/gtkdoc/annotations/tester.c.xml index 9bdbc0ec..d28d5d9b 100644 --- a/tests/scanner/annotationparser/gtkdoc/annotations/tester.c.xml +++ b/tests/scanner/annotationparser/gtkdoc/annotations/tester.c.xml @@ -138,9 +138,6 @@ - - 9: Warning: Test: unexpected annotation: allow-none - /** * annotation_nullable: diff --git a/tests/scanner/regress.c b/tests/scanner/regress.c index 875b1360..1bad36e3 100644 --- a/tests/scanner/regress.c +++ b/tests/scanner/regress.c @@ -1189,7 +1189,7 @@ regress_test_table_ghash_const (void) /** * regress_test_ghash_null_return: * - * Return value: (element-type utf8 utf8) (transfer none): + * Return value: (element-type utf8 utf8) (transfer none) (allow-none): */ const GHashTable * regress_test_ghash_null_return (void) -- cgit v1.2.1