mkdocstrings-matlab 0.9.1__tar.gz → 0.9.3__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 (91) hide show
  1. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/.github/workflows/docs.yaml +6 -0
  2. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/.github/workflows/qualify.yaml +2 -1
  3. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/.github/workflows/release.yaml +44 -42
  4. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/CHANGELOG.md +47 -0
  5. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/PKG-INFO +2 -2
  6. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/pyproject.toml +2 -2
  7. mkdocstrings_matlab-0.9.3/renovate.json +13 -0
  8. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/handler.py +9 -1
  9. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/treesitter.py +47 -18
  10. mkdocstrings_matlab-0.9.1/renovate.json +0 -6
  11. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/.github/CODEOWNERS +0 -0
  12. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/.github/workflows/update-templates.yaml +0 -0
  13. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/.gitignore +0 -0
  14. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/.python-version +0 -0
  15. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/.vscode/launch.json +0 -0
  16. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/.vscode/settings.json +0 -0
  17. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/LICENSE +0 -0
  18. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/README.md +0 -0
  19. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/api.md +0 -0
  20. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/changelog.md +0 -0
  21. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/credits.md +0 -0
  22. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/debug.py +0 -0
  23. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/img/preview_dark.png +0 -0
  24. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/img/preview_light.png +0 -0
  25. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/index.md +0 -0
  26. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/license.md +0 -0
  27. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/logo.png +0 -0
  28. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/logo.svg +0 -0
  29. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/overrides/main.html +0 -0
  30. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/overrides/partials/toc-item.html +0 -0
  31. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+module/+submodule/Contents.m +0 -0
  32. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+module/+submodule/subfunction.m +0 -0
  33. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+module/aClass.m +0 -0
  34. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+module/do_something.m +0 -0
  35. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+module/module.md +0 -0
  36. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+module/readme.md +0 -0
  37. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+mymembers/BaseClass.m +0 -0
  38. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+mymembers/Contents.m +0 -0
  39. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+mymembers/ThisClass.m +0 -0
  40. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+mymembers/mymembers.md +0 -0
  41. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+mymembers/this_function.m +0 -0
  42. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+mynamespace/classA.m +0 -0
  43. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+mynamespace/classB.m +0 -0
  44. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+mynamespace/mynamespace.md +0 -0
  45. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+mynamespace/myscript.m +0 -0
  46. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+mynamespace/readme.md +0 -0
  47. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+mynamespace/typed_function.m +0 -0
  48. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+undocumented/ClassWithoutDocstring.m +0 -0
  49. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+undocumented/function_with_docstring.m +0 -0
  50. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+undocumented/function_without_docstring.m +0 -0
  51. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/+undocumented/undocumented.md +0 -0
  52. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/Class.m +0 -0
  53. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/OtherClass.m +0 -0
  54. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/Thing.m +0 -0
  55. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/do_output.m +0 -0
  56. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/do_something.m +0 -0
  57. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/do_varargin.m +0 -0
  58. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/myClass.m +0 -0
  59. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/myParent.m +0 -0
  60. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/myfunction.m +0 -0
  61. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/snippets/print_hello.m +0 -0
  62. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/stylesheets/extra.css +0 -0
  63. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/usage/configuration/docstrings.md +0 -0
  64. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/usage/configuration/general.md +0 -0
  65. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/usage/configuration/headings.md +0 -0
  66. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/usage/configuration/members.md +0 -0
  67. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/usage/configuration/signatures.md +0 -0
  68. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/usage/docstrings/google.md +0 -0
  69. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/usage/docstrings/numpy.md +0 -0
  70. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/usage/docstrings/sphinx.md +0 -0
  71. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/docs/usage/index.md +0 -0
  72. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/logo.svg +0 -0
  73. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/mkdocs.yml +0 -0
  74. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/requirements.lock +0 -0
  75. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/scripts/copy_and_update_python_templates.py +0 -0
  76. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/__init__.py +0 -0
  77. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/collect.py +0 -0
  78. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/enums.py +0 -0
  79. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/models.py +0 -0
  80. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/py.typed +0 -0
  81. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/templates/material/children.html.jinja +0 -0
  82. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/templates/material/docstring/namespaces.html.jinja +0 -0
  83. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/templates/material/docstring/properties.html.jinja +0 -0
  84. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/templates/material/folder.html.jinja +0 -0
  85. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/templates/material/namespace.html.jinja +0 -0
  86. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/templates/material/property.html.jinja +0 -0
  87. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/templates/material/script.html.jinja +0 -0
  88. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/templates/material/style.css +0 -0
  89. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/templates/material/summary/namespaces.html.jinja +0 -0
  90. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/templates/material/summary/properties.html.jinja +0 -0
  91. {mkdocstrings_matlab-0.9.1 → mkdocstrings_matlab-0.9.3}/src/mkdocstrings_handlers/matlab/templates/material/summary.html.jinja +0 -0
@@ -19,6 +19,11 @@ on:
19
19
  Set the alias as the default version
20
20
  type: boolean
21
21
  default: true
22
+ ref:
23
+ description: >-
24
+ The ref to checkout and use to create docs
25
+ type: string
26
+ default: ""
22
27
  push:
23
28
  description: >-
24
29
  Push the documentation to the remote branch
@@ -36,6 +41,7 @@ jobs:
36
41
  - uses: actions/checkout@v4
37
42
  with:
38
43
  fetch-depth: 0 # Required to push to the documentation branch
44
+ ref: ${{ inputs.ref }}
39
45
 
40
46
  - name: Install the latest version of uv
41
47
  uses: astral-sh/setup-uv@v5
@@ -20,7 +20,7 @@ permissions:
20
20
 
21
21
  jobs:
22
22
  docs:
23
- if: github.event.pull_request.draft == false
23
+ if: contains(github.event.pull_request.labels.*.name, 'documentation')
24
24
  name: Test deploy documentation
25
25
  uses: ./.github/workflows/docs.yaml
26
26
  concurrency:
@@ -35,6 +35,7 @@ jobs:
35
35
 
36
36
  check-semantic-version:
37
37
  name: Check semantic version
38
+ if: github.repository == 'watermarkhu/mkdocstrings-matlab'
38
39
  runs-on: ubuntu-latest
39
40
  steps:
40
41
 
@@ -10,6 +10,46 @@ permissions:
10
10
  id-token: write
11
11
 
12
12
  jobs:
13
+ delete-test-document:
14
+ name: Delete test documentation
15
+ runs-on: ubuntu-latest
16
+ if: contains( github.event.pull_request.labels.*.name, 'documentation')
17
+ concurrency:
18
+ group: gh-pages
19
+ cancel-in-progress: false
20
+
21
+ steps:
22
+ - name: checkout repository
23
+ uses: actions/checkout@v4
24
+ with:
25
+ fetch-depth: 0 # Required to push to the documentation branch
26
+
27
+ - name: Install the latest version of uv
28
+ uses: astral-sh/setup-uv@v5
29
+ with:
30
+ version: "latest"
31
+
32
+ - name: Sync dependencies
33
+ run: |
34
+ uv sync --no-dev --group docs
35
+
36
+ - name: Configure Git Credentials
37
+ run: |
38
+ git config --global user.name github-actions[bot]
39
+ git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
40
+ git fetch origin gh-pages:gh-pages
41
+
42
+ - name: delete testing documentation
43
+ continue-on-error: true
44
+ env:
45
+ VERSION: ${{ format('pr-{0}', github.head_ref) || 'test' }}
46
+ run: >
47
+ uv run mike delete
48
+ --push --ignore-remote-status
49
+ --config-file mkdocs.yml
50
+ --branch gh-pages
51
+ $VERSION
52
+
13
53
  publish:
14
54
  if: github.event.pull_request.merged == true
15
55
  name: Semantic version release
@@ -55,7 +95,7 @@ jobs:
55
95
 
56
96
  - name: Update version and changelogs
57
97
  id: semantic-release
58
- uses: python-semantic-release/python-semantic-release@v9.16.1
98
+ uses: python-semantic-release/python-semantic-release@v9.17.0
59
99
  with:
60
100
  build: false
61
101
  changelog: true
@@ -81,58 +121,20 @@ jobs:
81
121
  - name: Publish package distributions to GitHub Releases
82
122
  if: steps.semantic-release.outputs.released == 'true'
83
123
  id: publish-dist
84
- uses: python-semantic-release/publish-action@v9.16.1
124
+ uses: python-semantic-release/publish-action@v9.17.0
85
125
  with:
86
126
  github_token: ${{ steps.app-token.outputs.token }}
87
127
  tag: ${{ steps.semantic-release.outputs.tag }}
88
128
 
89
- delete-test-document:
90
- name: Delete test documentation
91
- needs: publish
92
- runs-on: ubuntu-latest
93
- concurrency:
94
- group: gh-pages
95
- cancel-in-progress: false
96
-
97
- steps:
98
- - name: checkout repository
99
- uses: actions/checkout@v4
100
- with:
101
- fetch-depth: 0 # Required to push to the documentation branch
102
-
103
- - name: Install the latest version of uv
104
- uses: astral-sh/setup-uv@v5
105
- with:
106
- version: "latest"
107
-
108
- - name: Sync dependencies
109
- run: |
110
- uv sync --no-dev --group docs
111
-
112
- - name: Configure Git Credentials
113
- run: |
114
- git config --global user.name github-actions[bot]
115
- git config --global user.email 41898282+github-actions[bot]@users.noreply.github.com
116
- git fetch origin gh-pages:gh-pages
117
-
118
- - name: delete testing documentation
119
- continue-on-error: true
120
- env:
121
- VERSION: ${{ format('pr-{0}', github.head_ref) || 'test' }}
122
- run: >
123
- uv run mike delete
124
- --push --ignore-remote-status
125
- --config-file mkdocs.yml
126
- --branch gh-pages
127
- $VERSION
128
-
129
129
  mkdocs:
130
130
  name: Deploy documentation
131
131
  needs: [publish, delete-test-document]
132
+ if: ${{ always() && !failure() && !cancelled() }}
132
133
  uses: ./.github/workflows/docs.yaml
133
134
  secrets: inherit
134
135
  with:
135
136
  version: ${{ needs.publish.outputs.tag }}
136
137
  alias: latest
137
138
  set-default: true
139
+ ref: ${{ needs.publish.outputs.tag }}
138
140
  push: true
@@ -1,6 +1,53 @@
1
1
  # CHANGELOG
2
2
 
3
3
 
4
+ ## v0.9.3 (2025-01-29)
5
+
6
+ ### Bug Fixes
7
+
8
+ - Ignore `%#codegen` compilation directive
9
+ ([#61](https://github.com/watermarkhu/mkdocstrings-matlab/pull/61),
10
+ [`7239847`](https://github.com/watermarkhu/mkdocstrings-matlab/commit/72398479b347ed778c516e4e1fdad6ab8b6ccdc1))
11
+
12
+ * fix: Ignore `%#codegen` compilation directive
13
+
14
+ * Exclude all pragmas instead of only %#codegen
15
+
16
+ Co-authored-by: Mark Shui Hu <watermarkhu@gmail.com>
17
+
18
+ ---------
19
+
20
+ ### Chores
21
+
22
+ - Make sure that release documentation is using the new version
23
+ ([#60](https://github.com/watermarkhu/mkdocstrings-matlab/pull/60),
24
+ [`c3a9899`](https://github.com/watermarkhu/mkdocstrings-matlab/commit/c3a9899a9b3c031a72880df1b50b09b28206890f))
25
+
26
+ * Update docs.yaml
27
+
28
+ * Update release.yaml
29
+
30
+ * Update qualify.yaml
31
+
32
+
33
+ ## v0.9.2 (2025-01-26)
34
+
35
+ ### Bug Fixes
36
+
37
+ - **deps**: Update deps ([#59](https://github.com/watermarkhu/mkdocstrings-matlab/pull/59),
38
+ [`131c30c`](https://github.com/watermarkhu/mkdocstrings-matlab/commit/131c30ca6046a85def35f37f5f2a3d48e9815f2d))
39
+
40
+ * chore(deps): update python-semantic-release/python-semantic-release action to v9.17.0 (#55)
41
+
42
+ Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
43
+
44
+ * chore(deps): update python-semantic-release/publish-action action to v9.17.0 (#54)
45
+
46
+ * fix(deps): update dependency tree-sitter to v0.24.0 (#53)
47
+
48
+ ---------
49
+
50
+
4
51
  ## v0.9.1 (2025-01-16)
5
52
 
6
53
  ### Bug Fixes
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mkdocstrings-matlab
3
- Version: 0.9.1
3
+ Version: 0.9.3
4
4
  Summary: A MATLAB handler for mkdocstrings
5
5
  Author-email: Mark Hu <watermarkhu@gmail.com>
6
6
  License: MIT
@@ -25,7 +25,7 @@ Requires-Dist: charset-normalizer==3.4.1
25
25
  Requires-Dist: mkdocstrings-python==1.13.0
26
26
  Requires-Dist: mkdocstrings==0.27.0
27
27
  Requires-Dist: tree-sitter-matlab==1.0.3
28
- Requires-Dist: tree-sitter==0.23.2
28
+ Requires-Dist: tree-sitter==0.24.0
29
29
  Description-Content-Type: text/markdown
30
30
 
31
31
  <!-- --8<-- [start:header] -->
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mkdocstrings-matlab"
3
- version = "0.9.1"
3
+ version = "0.9.3"
4
4
  description = "A MATLAB handler for mkdocstrings"
5
5
  authors = [
6
6
  { name = "Mark Hu", email = "watermarkhu@gmail.com" }
@@ -12,7 +12,7 @@ dependencies = [
12
12
  "mkdocstrings==0.27.0",
13
13
  "mkdocstrings-python==1.13.0",
14
14
  "charset-normalizer==3.4.1",
15
- "tree-sitter==0.23.2",
15
+ "tree-sitter==0.24.0",
16
16
  "tree-sitter-matlab==1.0.3",
17
17
  ]
18
18
  classifiers = [
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
+ "extends": [
4
+ "config:recommended"
5
+ ],
6
+ "branchPrefix": "renovate-",
7
+ "packageRules": [
8
+ {
9
+ "description": "Group GitHub Action updates",
10
+ "matchManagers": ["github-actions"]
11
+ }
12
+ ]
13
+ }
@@ -358,7 +358,15 @@ class MatlabHandler(BaseHandler):
358
358
  raise CollectionError("Empty identifier")
359
359
 
360
360
  final_config = ChainMap(config, self.default_config) # type: ignore[arg-type]
361
- model = self.paths.resolve(identifier, config=final_config)
361
+ try:
362
+ model = self.paths.resolve(identifier, config=final_config)
363
+ except SyntaxError as ex:
364
+ msg = str(ex)
365
+ if ex.text:
366
+ msg += ':\n' + ex.text
367
+ raise CollectionError(msg) from ex
368
+ except Exception as ex:
369
+ raise CollectionError(str(ex)) from ex
362
370
  if model is None:
363
371
  raise CollectionError(f"Identifier '{identifier}' not found")
364
372
  return model
@@ -198,6 +198,7 @@ class FileParser(object):
198
198
  self.encoding: str = result.encoding if result else "utf-8"
199
199
  with open(filepath, "rb") as f:
200
200
  self._content: bytes = f.read()
201
+ self._node: Node | None = None
201
202
 
202
203
  @property
203
204
  def content(self):
@@ -226,26 +227,38 @@ class FileParser(object):
226
227
  Raises:
227
228
  ValueError: If the file could not be parsed.
228
229
  """
229
- tree = PARSER.parse(self._content)
230
- cursor = tree.walk()
231
-
232
- if cursor.node is None:
233
- raise ValueError(f"The file {self.filepath} could not be parsed.")
234
- captures = FILE_QUERY.captures(cursor.node)
235
-
236
- if "function" in captures:
237
- model = self._parse_function(captures["function"][0], **kwargs)
238
- elif "class" in captures:
239
- model = self._parse_class(captures["class"][0], **kwargs)
240
- else:
241
- model = Script(self.filepath.stem, filepath=self.filepath, **kwargs)
230
+ try:
231
+ tree = PARSER.parse(self._content)
232
+ cursor = tree.walk()
233
+
234
+ if cursor.node is None:
235
+ raise ValueError(f"The file {self.filepath} could not be parsed.")
236
+ captures = FILE_QUERY.captures(cursor.node)
237
+ if "function" in captures:
238
+ model = self._parse_function(captures["function"][0], **kwargs)
239
+ elif "class" in captures:
240
+ model = self._parse_class(captures["class"][0], **kwargs)
241
+ else:
242
+ model = Script(self.filepath.stem, filepath=self.filepath, **kwargs)
242
243
 
243
- if not model.docstring:
244
- model.docstring = self._comment_docstring(
245
- captures.get("header", None), parent=model
246
- )
244
+ if not model.docstring:
245
+ model.docstring = self._comment_docstring(
246
+ captures.get("header", None), parent=model
247
+ )
247
248
 
248
- return model
249
+ return model
250
+ except Exception as ex:
251
+ syntax_error = SyntaxError(f"Error parsing Matlab file")
252
+ syntax_error.filename = str(self.filepath)
253
+ if self._node is not None:
254
+ if self._node.text is not None:
255
+ indentation = ' ' * self._node.start_point.column
256
+ syntax_error.text = indentation + self._node.text.decode(self.encoding)
257
+ syntax_error.lineno = self._node.start_point.row + 1
258
+ syntax_error.offset = self._node.start_point.column + 1
259
+ syntax_error.end_lineno = self._node.end_point.row + 1
260
+ syntax_error.end_offset = self._node.end_point.column + 1
261
+ raise syntax_error from ex
249
262
 
250
263
  def _parse_class(self, node: Node, **kwargs: Any) -> Class:
251
264
  """
@@ -262,6 +275,7 @@ class FileParser(object):
262
275
  Returns:
263
276
  Class: The parsed Class or Classfolder model.
264
277
  """
278
+ self._node = node
265
279
  saved_kwargs = {key: value for key, value in kwargs.items()}
266
280
  captures = CLASS_QUERY.captures(node)
267
281
 
@@ -401,6 +415,7 @@ class FileParser(object):
401
415
  The value is `True` if no value is specified,
402
416
  otherwise it is the parsed value which can be a boolean or a string.
403
417
  """
418
+ self._node = node
404
419
  captures = ATTRIBUTE_QUERY.captures(node)
405
420
 
406
421
  key = self._first_from_capture(captures, "name")
@@ -429,6 +444,7 @@ class FileParser(object):
429
444
  KeyError: If required captures are missing from the node.
430
445
 
431
446
  """
447
+ self._node = node
432
448
  captures: dict = FUNCTION_QUERY.matches(node)[0][1]
433
449
 
434
450
  input_names = self._decode_from_capture(captures, "input")
@@ -529,6 +545,7 @@ class FileParser(object):
529
545
  Returns:
530
546
  str: The decoded text of the node. If the node or its text is None, returns an empty string.
531
547
  """
548
+ self._node = node
532
549
  return (
533
550
  node.text.decode(self.encoding)
534
551
  if node is not None and node.text is not None
@@ -621,6 +638,18 @@ class FileParser(object):
621
638
  except StopIteration:
622
639
  break
623
640
 
641
+ # Exclude all pragma's
642
+ if line in [
643
+ '%#codegen',
644
+ '%#eml',
645
+ '%#external',
646
+ '%#exclude',
647
+ '%#function',
648
+ '%#ok',
649
+ '%#mex',
650
+ ]:
651
+ continue
652
+
624
653
  if "--8<--" in line:
625
654
  continue
626
655
 
@@ -1,6 +0,0 @@
1
- {
2
- "$schema": "https://docs.renovatebot.com/renovate-schema.json",
3
- "extends": [
4
- "config:recommended"
5
- ]
6
- }