Repository: Viatorus/quom

Issue:
option to skip already included files
Hello and thanks for creating such awesome utility! I'm using it in my [CTRE](https://github.com/hanickadot/compile-time-regular-expressions) project. I noticed sometimes quom include same file multiple times. 

Would be possible to add an option to ignore already included files? Based on normalised URL preferably. 

Thanks! ❤️

Discussion:

Patch:
diff --git a/src/quom/quom.py b/src/quom/quom.py
index 5dbaad9..5f7d51c 100644
--- a/src/quom/quom.py
+++ b/src/quom/quom.py
@@ -80,6 +80,7 @@ class Quom:
                 raise QuomError('Include not found: "{}"'.format(include_path))
 
         # Skip already processed files.
+        file_path = file_path.resolve()
         if file_path in self.__processed_files:
             return
         self.__processed_files.add(file_path)


Test patch:
diff --git a/tests/test_quom/same_file_different_include.py b/tests/test_quom/same_file_different_include.py
new file mode 100644
index 0000000..8ef3b9d
--- /dev/null
+++ b/tests/test_quom/same_file_different_include.py
@@ -0,0 +1,41 @@
+import os
+from io import StringIO
+
+from quom import Quom
+
+FILE_FOO_HPP = """
+#include "../b/bar.hpp"
+"""
+
+FILE_BAR_HPP = """
+int foo();
+"""
+
+FILE_MAIN_CPP = """
+#include "a/foo.hpp"
+#include "b/bar.hpp"
+"""
+
+RESULT = """
+
+int foo();
+"""
+
+
+def test_same_file_different_include(fs):
+    os.makedirs('a')
+    os.makedirs('b')
+
+    with open('main.cpp', 'w+') as file:
+        file.write(FILE_MAIN_CPP)
+
+    with open('a/foo.hpp', 'w+') as file:
+        file.write(FILE_FOO_HPP)
+
+    with open('b/bar.hpp', 'w+') as file:
+        file.write(FILE_BAR_HPP)
+
+    dst = StringIO()
+    Quom('main.cpp', dst)
+
+    assert dst.getvalue() == RESULT