nmhit 0.1.2__tar.gz → 0.1.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {nmhit-0.1.2 → nmhit-0.1.4}/CMakeLists.txt +16 -8
  2. {nmhit-0.1.2 → nmhit-0.1.4}/PKG-INFO +1 -1
  3. {nmhit-0.1.2 → nmhit-0.1.4}/generated/Lexer.cpp +365 -82
  4. {nmhit-0.1.2 → nmhit-0.1.4}/generated/Lexer.h +234 -4
  5. {nmhit-0.1.2 → nmhit-0.1.4}/generated/Parser.cpp +3 -71
  6. {nmhit-0.1.2 → nmhit-0.1.4}/generated/Parser.h +4 -10
  7. {nmhit-0.1.2 → nmhit-0.1.4}/generated/location.hh +4 -8
  8. {nmhit-0.1.2 → nmhit-0.1.4}/include/nmhit/Node.h +10 -0
  9. {nmhit-0.1.2 → nmhit-0.1.4}/pyproject.toml +1 -1
  10. {nmhit-0.1.2 → nmhit-0.1.4}/src/Lexer.l +4 -4
  11. {nmhit-0.1.2 → nmhit-0.1.4}/src/Node.cpp +42 -21
  12. {nmhit-0.1.2 → nmhit-0.1.4}/src/ParseDriver.h +4 -4
  13. {nmhit-0.1.2 → nmhit-0.1.4}/src/Parser.y +3 -3
  14. {nmhit-0.1.2 → nmhit-0.1.4}/tests/test_hit.cpp +112 -0
  15. {nmhit-0.1.2 → nmhit-0.1.4}/.clang-format +0 -0
  16. {nmhit-0.1.2 → nmhit-0.1.4}/.github/workflows/ci.yml +0 -0
  17. {nmhit-0.1.2 → nmhit-0.1.4}/.github/workflows/release.yml +0 -0
  18. {nmhit-0.1.2 → nmhit-0.1.4}/.gitignore +0 -0
  19. {nmhit-0.1.2 → nmhit-0.1.4}/.pre-commit-config.yaml +0 -0
  20. {nmhit-0.1.2 → nmhit-0.1.4}/CONTRIBUTING.md +0 -0
  21. {nmhit-0.1.2 → nmhit-0.1.4}/README.md +0 -0
  22. {nmhit-0.1.2 → nmhit-0.1.4}/cmake/nmhit.pc.in +0 -0
  23. {nmhit-0.1.2 → nmhit-0.1.4}/cmake/nmhitConfig.cmake.in +0 -0
  24. {nmhit-0.1.2 → nmhit-0.1.4}/include/nmhit/BraceExpr.h +0 -0
  25. {nmhit-0.1.2 → nmhit-0.1.4}/include/nmhit/TypeRegistry.h +0 -0
  26. {nmhit-0.1.2 → nmhit-0.1.4}/include/nmhit/nmhit.h +0 -0
  27. {nmhit-0.1.2 → nmhit-0.1.4}/python/nmhit/__init__.py +0 -0
  28. {nmhit-0.1.2 → nmhit-0.1.4}/python/nmhit/py.typed +0 -0
  29. {nmhit-0.1.2 → nmhit-0.1.4}/python/src/_nmhit.cpp +0 -0
  30. {nmhit-0.1.2 → nmhit-0.1.4}/python/tests/test_nmhit.py +0 -0
  31. {nmhit-0.1.2 → nmhit-0.1.4}/src/BraceExpr.cpp +0 -0
  32. {nmhit-0.1.2 → nmhit-0.1.4}/tests/CMakeLists.txt +0 -0
@@ -1,5 +1,6 @@
1
1
  cmake_minimum_required(VERSION 3.20)
2
- project(neml2-hit VERSION 0.1.0 LANGUAGES CXX)
2
+ # Keep this version in sync with [project] version in pyproject.toml.
3
+ project(neml2-hit VERSION 0.1.4 LANGUAGES CXX)
3
4
 
4
5
  set(CMAKE_CXX_STANDARD 17)
5
6
  set(CMAKE_CXX_STANDARD_REQUIRED ON)
@@ -19,6 +20,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR NOT CMAKE_BUILD_TYPE)
19
20
  src/Lexer.l
20
21
  ${CMAKE_CURRENT_BINARY_DIR}/Lexer.cpp
21
22
  DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/Lexer.h
23
+ COMPILE_FLAGS "--noline"
22
24
  )
23
25
 
24
26
  BISON_TARGET(
@@ -26,6 +28,7 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR NOT CMAKE_BUILD_TYPE)
26
28
  src/Parser.y
27
29
  ${CMAKE_CURRENT_BINARY_DIR}/Parser.cpp
28
30
  DEFINES_FILE ${CMAKE_CURRENT_BINARY_DIR}/Parser.h
31
+ COMPILE_FLAGS "--no-lines"
29
32
  )
30
33
 
31
34
  ADD_FLEX_BISON_DEPENDENCY(HITLexer HITParser)
@@ -37,18 +40,23 @@ if(CMAKE_BUILD_TYPE STREQUAL "Debug" OR NOT CMAKE_BUILD_TYPE)
37
40
  set(_parser_include_dir ${CMAKE_CURRENT_BINARY_DIR})
38
41
 
39
42
  # Helper target: copy freshly-generated files back to generated/ for committing.
43
+ # The sed step removes any residual #line directives (flex emits one before
44
+ # %top{} even with --noline) so no local filesystem paths leak into the repo.
45
+ set(_gen_dest ${CMAKE_CURRENT_SOURCE_DIR}/generated)
40
46
  add_custom_target(update_generated
41
47
  COMMAND ${CMAKE_COMMAND} -E copy
42
- ${CMAKE_CURRENT_BINARY_DIR}/Lexer.cpp
43
- ${CMAKE_CURRENT_BINARY_DIR}/Lexer.h
44
- ${CMAKE_CURRENT_BINARY_DIR}/Parser.cpp
45
- ${CMAKE_CURRENT_BINARY_DIR}/Parser.h
46
- ${CMAKE_CURRENT_BINARY_DIR}/location.hh
47
- ${CMAKE_CURRENT_SOURCE_DIR}/generated/
48
+ Lexer.cpp Lexer.h Parser.cpp Parser.h location.hh ${_gen_dest}/
49
+ COMMAND sed -i "/^#line /d"
50
+ ${_gen_dest}/Lexer.cpp
51
+ ${_gen_dest}/Lexer.h
52
+ ${_gen_dest}/Parser.cpp
53
+ ${_gen_dest}/Parser.h
54
+ ${_gen_dest}/location.hh
55
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
48
56
  DEPENDS
49
57
  ${FLEX_HITLexer_OUTPUTS}
50
58
  ${BISON_HITParser_OUTPUTS}
51
- COMMENT "Copying generated parser/lexer files to generated/"
59
+ COMMENT "Stripping #line directives and copying generated parser/lexer files to generated/"
52
60
  )
53
61
  else()
54
62
  set(_parser_sources
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: nmhit
3
- Version: 0.1.2
3
+ Version: 0.1.4
4
4
  Summary: Python bindings for the nmhit NEML2-flavored HIT parser
5
5
  License: MIT
6
6
  Classifier: Programming Language :: Python :: 3