@@ -15,8 +15,6 @@ Enforce argument declaration ordering:
15
15
Throw `ArgumentError` if ordering violates this rule.
16
16
"""
17
17
function _validateorder (block:: Expr )
18
- encountered_description = false
19
- encountered_argument = false
20
18
encountered_positional = false
21
19
encoundered_optional_positional = false
22
20
@@ -26,30 +24,13 @@ function _validateorder(block::Expr)
26
24
# Fix namespace issues
27
25
macroname:: Symbol = _get_macroname (arg)
28
26
29
- if macroname == usage_symbol
30
- if encountered_description || encountered_argument
31
- throw (ArgumentError (
32
- " Usage must be stated before description or arguments.\n From: $arg "
33
- ))
34
- end
35
- elseif macroname == description_symbol
36
- encountered_description = true
37
-
38
- if encountered_argument
39
- throw (ArgumentError (
40
- " Description must be stated before any arguments.\n From: $arg "
41
- ))
42
- end
43
- elseif macroname in flagged_symbols
44
- encountered_argument = true
45
-
27
+ if macroname in flagged_symbols
46
28
if encountered_positional
47
29
throw (ArgumentError (
48
30
" Positional arguments must be declared after all flagged arguments.\n From: $arg "
49
31
))
50
32
end
51
33
elseif macroname == positional_required_symbol
52
- encountered_argument = true
53
34
encountered_positional = true
54
35
55
36
if encoundered_optional_positional
@@ -58,7 +39,6 @@ function _validateorder(block::Expr)
58
39
))
59
40
end
60
41
elseif macroname in positional_optional_symbols
61
- encountered_argument = true
62
42
encountered_positional = true
63
43
encoundered_optional_positional = true
64
44
end
0 commit comments