diff --git a/src/dparse/parser.d b/src/dparse/parser.d index 8eb14a7c..9fb502c7 100644 --- a/src/dparse/parser.d +++ b/src/dparse/parser.d @@ -2831,17 +2831,17 @@ class Parser mixin (tokenCheck!(`node.name`, `identifier`)); node.comment = comment; comment = null; + if (currentIs(tok!":")) + { + advance(); // skip ':' + mixin(parseNodeQ!(`node.type`, `Type`)); + } if (currentIs(tok!";")) { advance(); node.tokens = tokens[startIndex .. index]; return node; } - if (currentIs(tok!":")) - { - advance(); // skip ':' - mixin(parseNodeQ!(`node.type`, `Type`)); - } mixin(parseNodeQ!(`node.enumBody`, `EnumBody`)); node.tokens = tokens[startIndex .. index]; return node; diff --git a/test/pass_files/enums.d b/test/pass_files/enums.d index bb75cc8c..6c8f5e80 100644 --- a/test/pass_files/enums.d +++ b/test/pass_files/enums.d @@ -18,3 +18,7 @@ enum E @A @B deprecated("meep") member, deprecated("meep") member } + +// https://github.com/dlang-community/libdparse/issues/390 +enum F; +enum G : long;