mbdyn-lexer 0.0.1__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.
@@ -0,0 +1,107 @@
1
+ Metadata-Version: 2.4
2
+ Name: mbdyn_lexer
3
+ Version: 0.0.1
4
+ Summary: Pygments Lexer Class for MBDyn Inputfiles
5
+ Project-URL: Homepage, https://gitlab.com/musipadcom/mbdyn-lexer
6
+ Project-URL: Issues, https://gitlab.com/musipadcom/mbdyn-lexer/issues
7
+ Author-email: Andre Zettel <musipadcom@gmail.com>
8
+ Maintainer-email: Andre Zettel <musipadcom@gmail.com>
9
+ License-Expression: GPL-3.0-or-later
10
+ Classifier: Operating System :: OS Independent
11
+ Classifier: Programming Language :: Python :: 3
12
+ Requires-Python: >=3.8
13
+ Description-Content-Type: text/markdown
14
+
15
+ # mbdyn-lexer
16
+
17
+
18
+
19
+ ## Getting started
20
+
21
+ To make it easy for you to get started with GitLab, here's a list of recommended next steps.
22
+
23
+ Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
24
+
25
+ ## Add your files
26
+
27
+ - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
28
+ - [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
29
+
30
+ ```
31
+ cd existing_repo
32
+ git remote add origin https://gitlab.com/musipadcom/mbdyn-lexer.git
33
+ git branch -M main
34
+ git push -uf origin main
35
+ ```
36
+
37
+ ## Integrate with your tools
38
+
39
+ - [ ] [Set up project integrations](https://gitlab.com/musipadcom/mbdyn-lexer/-/settings/integrations)
40
+
41
+ ## Collaborate with your team
42
+
43
+ - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
44
+ - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
45
+ - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
46
+ - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
47
+ - [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
48
+
49
+ ## Test and Deploy
50
+
51
+ Use the built-in continuous integration in GitLab.
52
+
53
+ - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
54
+ - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
55
+ - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
56
+ - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
57
+ - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
58
+
59
+ ***
60
+
61
+ # Editing this README
62
+
63
+ When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
64
+
65
+ ## Suggestions for a good README
66
+
67
+ Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
68
+
69
+ ## Name
70
+ Choose a self-explaining name for your project.
71
+
72
+ ## Description
73
+ Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
74
+
75
+ ## Badges
76
+ On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
77
+
78
+ ## Visuals
79
+ Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
80
+
81
+ ## Installation
82
+ Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
83
+
84
+ ## Usage
85
+ Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
86
+
87
+ ## Support
88
+ Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
89
+
90
+ ## Roadmap
91
+ If you have ideas for releases in the future, it is a good idea to list them in the README.
92
+
93
+ ## Contributing
94
+ State if you are open to contributions and what your requirements are for accepting them.
95
+
96
+ For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
97
+
98
+ You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
99
+
100
+ ## Authors and acknowledgment
101
+ Show your appreciation to those who have contributed to the project.
102
+
103
+ ## License
104
+ For open source projects, say how it is licensed.
105
+
106
+ ## Project status
107
+ If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
@@ -0,0 +1,93 @@
1
+ # mbdyn-lexer
2
+
3
+
4
+
5
+ ## Getting started
6
+
7
+ To make it easy for you to get started with GitLab, here's a list of recommended next steps.
8
+
9
+ Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
10
+
11
+ ## Add your files
12
+
13
+ - [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
14
+ - [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
15
+
16
+ ```
17
+ cd existing_repo
18
+ git remote add origin https://gitlab.com/musipadcom/mbdyn-lexer.git
19
+ git branch -M main
20
+ git push -uf origin main
21
+ ```
22
+
23
+ ## Integrate with your tools
24
+
25
+ - [ ] [Set up project integrations](https://gitlab.com/musipadcom/mbdyn-lexer/-/settings/integrations)
26
+
27
+ ## Collaborate with your team
28
+
29
+ - [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
30
+ - [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
31
+ - [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
32
+ - [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
33
+ - [ ] [Set auto-merge](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
34
+
35
+ ## Test and Deploy
36
+
37
+ Use the built-in continuous integration in GitLab.
38
+
39
+ - [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
40
+ - [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing (SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
41
+ - [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
42
+ - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
43
+ - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
44
+
45
+ ***
46
+
47
+ # Editing this README
48
+
49
+ When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thanks to [makeareadme.com](https://www.makeareadme.com/) for this template.
50
+
51
+ ## Suggestions for a good README
52
+
53
+ Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
54
+
55
+ ## Name
56
+ Choose a self-explaining name for your project.
57
+
58
+ ## Description
59
+ Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
60
+
61
+ ## Badges
62
+ On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
63
+
64
+ ## Visuals
65
+ Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
66
+
67
+ ## Installation
68
+ Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
69
+
70
+ ## Usage
71
+ Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
72
+
73
+ ## Support
74
+ Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
75
+
76
+ ## Roadmap
77
+ If you have ideas for releases in the future, it is a good idea to list them in the README.
78
+
79
+ ## Contributing
80
+ State if you are open to contributions and what your requirements are for accepting them.
81
+
82
+ For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
83
+
84
+ You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
85
+
86
+ ## Authors and acknowledgment
87
+ Show your appreciation to those who have contributed to the project.
88
+
89
+ ## License
90
+ For open source projects, say how it is licensed.
91
+
92
+ ## Project status
93
+ If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
@@ -0,0 +1,29 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "mbdyn_lexer"
7
+ version = "0.0.1"
8
+ authors = [
9
+ {name = "Andre Zettel", email = "musipadcom@gmail.com"},
10
+ ]
11
+ maintainers = [
12
+ {name = "Andre Zettel", email = "musipadcom@gmail.com"},
13
+ ]
14
+ description = "Pygments Lexer Class for MBDyn Inputfiles"
15
+ readme = "README.md"
16
+ requires-python = ">=3.8"
17
+ classifiers = [
18
+ "Programming Language :: Python :: 3",
19
+ "Operating System :: OS Independent",
20
+ ]
21
+ license = "GPL-3.0-or-later"
22
+ license-files = ["LICEN[CS]E*"]
23
+
24
+ [project.urls]
25
+ Homepage = "https://gitlab.com/musipadcom/mbdyn-lexer"
26
+ Issues = "https://gitlab.com/musipadcom/mbdyn-lexer/issues"
27
+
28
+ [tool.hatch.build.targets.wheel]
29
+ packages = ["mbdynlexer"]
@@ -0,0 +1,24 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "mbdyn_lexer"
7
+ version = "0.0.1"
8
+ authors = [
9
+ { name="Andre Zettel", email="musipadcom@gmail.com" },
10
+ ]
11
+ description = "Pygments Lexer Class for MBDyn Inputfiles"
12
+ readme = "README.md"
13
+ requires-python = ">=3.8"
14
+ classifiers = [
15
+ "PluginProgramming Language :: Python :: 3",
16
+ "Operating System :: OS Independent",
17
+ "Topic :: Plugin",
18
+ ]
19
+ license = "GPL-3.0-or-later"
20
+ license-files = ["LICEN[CS]E*"]
21
+
22
+ [project.urls]
23
+ Homepage = "https://gitlab.com/musipadcom/mbdyn-lexer"
24
+ Issues = "https://gitlab.com/musipadcom/mbdyn-lexer/issues"
File without changes
@@ -0,0 +1,87 @@
1
+ '''
2
+ mbdynlexer.lexer
3
+ ~~~~~~~~~~~~~~~~
4
+
5
+ Lexer for MBDyn Inputfiles.
6
+
7
+ :copyright: Copyright 2024 by Andre Zettel.
8
+ :license: GPL, see http://www.gnu.org for details.
9
+ '''
10
+
11
+ import re
12
+
13
+ from pygments.lexers.python import PythonLexer
14
+ from pygments.lexer import RegexLexer, bygroups, using, words, default, this
15
+ from pygments.token import Text, Comment, String, Name, Keyword, \
16
+ Generic, Whitespace, Operator, Punctuation, Number
17
+
18
+ __all__ = ['MBDynLexer']
19
+
20
+
21
+ class MBDynLexer(RegexLexer):
22
+ '''
23
+ For MBDyn Inputfiles
24
+ Version MultiBody Dynamics develop (So 07 Jan 2024 17∶43∶15 CET)
25
+ '''
26
+
27
+ name = 'MBDynInputFile'
28
+ url = 'http://www.aero.polimi.it/'
29
+ aliases = ['MBdyn.mbd']
30
+ filenames = ['*.mbd']
31
+ mimetypes = ['application/mbdyn']
32
+
33
+ identifier = r'[$a-zA-Z_]\w*'
34
+
35
+ _decpart = r'\d(\'?\d)*'
36
+
37
+ flags = re.DOTALL
38
+
39
+ tokens = {
40
+ 'root': [
41
+ (r'\s+', Whitespace),
42
+
43
+ (r'/\*', Comment.Multiline, 'comment'),
44
+ (r'#beginpreprocess', Comment, 'prepro'),
45
+ (r'#.*?\n', Comment.Single),
46
+
47
+ (r'[bB]egin.*?:\s*\w*\s*\w*', Generic.Heading),
48
+ (r'[eE]nd.*?:\s*\w*\s*\w*', Generic.Heading),
49
+
50
+ (r'(\w*\s*\w*\s*\w*:\s*)', Generic.Strong),
51
+
52
+ # FIXME check if this is numbers in mbdyn 2.e2 = 200
53
+ (r'(-+)?(\d(\'?\d)*\.)[eE]\d(\'?\d)*',
54
+ Number.Float),
55
+
56
+ # FIXME check if this is numbers in mbdyn 2.e-2 = 0.02
57
+ (r'(-+)?(\d(\'?\d)*\.)[eE][+-]\d(\'?\d)*',
58
+ Number.Float),
59
+
60
+ # from c_pp lexer
61
+ (r'(-+)?(\d(\'?\d)*\.\d(\'?\d)*|\.\d(\'?\d)*|\d(\'?\d)*)[eE][+-]?\d(\'?\d)*\d(\'?\d)*',
62
+ Number.Float),
63
+
64
+ # from c_pp lexer
65
+ (r'(-+)?(\d(\'?\d)*\.(\d(\'?\d)*)?|\.\d(\'?\d)*)',
66
+ Number.Float),
67
+
68
+ (r'(-+)?' + _decpart, Number.Integer),
69
+
70
+ (identifier, Name.Label),
71
+
72
+ (r'[*+=\/\-\(\)\^\]\[]', Operator),
73
+ (r'[,;]', Punctuation),
74
+
75
+ (r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double),
76
+ ],
77
+ # -----------------------------------------------------------------
78
+
79
+ 'comment': [
80
+ (r'[^*/]+', Comment.Multiline),
81
+ (r'\*/', Comment.Multiline, '#pop'),
82
+ ],
83
+ 'prepro': [
84
+ (r'.+?(?=#endpreprocess)', using(PythonLexer), '#pop'),
85
+ ],
86
+ }
87
+