Add support for leafrefs

Change-Id: I2286aaa96abd960d13bb0b04a778fb264b2f74a4
diff --git a/src/ast_handlers.hpp b/src/ast_handlers.hpp
index 9fd65ff..5501247 100644
--- a/src/ast_handlers.hpp
+++ b/src/ast_handlers.hpp
@@ -428,7 +428,11 @@
         leaf_ leaf = boost::get<leaf_>(parserContext.m_curPath.m_nodes.back().m_suffix);
         schemaPath_ location = pathWithoutLastNode(parserContext.m_curPath);
 
-        if (schema.leafType(location, {module, leaf.m_name}) != m_type) {
+        auto type = schema.leafType(location, {module, leaf.m_name});
+        if (type == yang::LeafDataTypes::LeafRef) {
+            type = schema.leafrefBase(location, {module, leaf.m_name});
+        }
+        if (type != m_type) {
             _pass(context) = false;
         }
     }