Rework x3::rule parser

It's possible to define x3::rule's grammar directly. There's no need to
use the BOOST_SPIRIT_DEFINE macro and all the "*_def" stuff. The new
syntax has less boilerplate and is more concise. Some rules had to be
moved around, because now they aren't all defined at the begining of the
file.

There is also one big advantage to this: if you're browsing the parser
code and you're looking at a specifing grammar and want to see the
definition of some other used, you can use your IDE's "Go to
definition". Before you would have to also search the "_def" variable to
actually see the grammar. This is very useful.

Change-Id: I0994603171321a24b9cdf5d67057d5942001a970
diff --git a/src/common_parsers.hpp b/src/common_parsers.hpp
index e7bedd3..285234f 100644
--- a/src/common_parsers.hpp
+++ b/src/common_parsers.hpp
@@ -8,26 +8,21 @@
 #pragma once
 #include <boost/spirit/home/x3.hpp>
 #include "ast_handlers.hpp"
-x3::rule<module_identifier_class, std::string> const module_identifier = "module_identifier";
-x3::rule<module_class, module_> const module = "module";
-x3::rule<node_identifier_class, std::string> const node_identifier = "node_identifier";
-x3::rule<space_separator_class, x3::unused_type> const space_separator = "a space";
-x3::rule<completing_class, x3::unused_type> const completing = "completing";
 
 // This is a pseudo-parser, that fails if we're not completing a command
-auto const completing_def =
+auto const completing = x3::rule<completing_class, x3::unused_type>{"completing"} =
     x3::eps;
 
-auto const node_identifier_def =
+auto const node_identifier = x3::rule<node_identifier_class, std::string>{"node_identifier"} =
     ((x3::alpha | x3::char_("_")) >> *(x3::alnum | x3::char_("_") | x3::char_("-") | x3::char_(".")));
 
-auto const module_def =
+auto const module_identifier = x3::rule<module_identifier_class, std::string>{"module_identifier"} =
+    ((x3::alpha | x3::char_("_")) >> *(x3::alnum | x3::char_("_") | x3::char_("-") | x3::char_(".")));
+
+auto const module = x3::rule<module_class, module_>{"module"} =
     module_identifier >> ':' >> !x3::space;
 
-auto const module_identifier_def =
-    ((x3::alpha | x3::char_("_")) >> *(x3::alnum | x3::char_("_") | x3::char_("-") | x3::char_(".")));
-
-auto const space_separator_def =
+auto const space_separator = x3::rule<space_separator_class, x3::unused_type>{"a space"} =
     x3::omit[+x3::space];
 
 template <typename CoerceTo>
@@ -45,9 +40,3 @@
 // someParser will have its attribute coerced to std::string
 // https://github.com/boostorg/spirit/issues/530#issuecomment-584836532
 template <typename CoerceTo> const as_type<CoerceTo> as{};
-
-BOOST_SPIRIT_DEFINE(node_identifier)
-BOOST_SPIRIT_DEFINE(module)
-BOOST_SPIRIT_DEFINE(module_identifier)
-BOOST_SPIRIT_DEFINE(space_separator)
-BOOST_SPIRIT_DEFINE(completing)