openscad-parser 2.4.8__tar.gz → 2.5.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openscad_parser
3
- Version: 2.4.8
3
+ Version: 2.5.0
4
4
  Summary: A PEG parser to read OpenSCAD language source code, with optional AST tree generation.
5
5
  Keywords: openscad,openscad parser,parser
6
6
  Author: Revar Desmera
@@ -4,7 +4,7 @@ build-backend = "uv_build"
4
4
 
5
5
  [project]
6
6
  name = "openscad_parser"
7
- version = "2.4.8"
7
+ version = "2.5.0"
8
8
  description = "A PEG parser to read OpenSCAD language source code, with optional AST tree generation."
9
9
  readme = "README.rst"
10
10
  authors = [
@@ -10,6 +10,7 @@ from .nodes import (
10
10
  ASTNode,
11
11
  CommentLine,
12
12
  CommentSpan,
13
+ CommentedExpr,
13
14
  Expression,
14
15
  Primary,
15
16
  Identifier,
@@ -337,11 +338,8 @@ def getASTfromFile(file: str, include_comments: bool = False, process_includes:
337
338
  del _ast_cache[cache_key]
338
339
 
339
340
  # Read the file
340
- try:
341
- with open(file_path, 'r', encoding='utf-8') as f:
342
- code = f.read()
343
- except Exception as e:
344
- raise Exception(f"Error reading file {file}: {e}")
341
+ with open(file_path, 'r', encoding='utf-8') as f:
342
+ code = f.read()
345
343
 
346
344
  # Create source map and process includes if requested
347
345
  source_map = SourceMap()