Skip to content

Commit

Permalink
[FEATURE] Add grammar, translations and better parser
Browse files Browse the repository at this point in the history
[FEATURE] Add grammar, translations and better parser in #71 by @ElBe-Plaq, contributing to Release v1.0.0-alpha3

Changed files:
- '.editorconfig'
- '.github/CONTRIBUTING.md'
- '.github/README.md'
- '.github/SECURITY.md'
- '.github/SUPPORT.md'
- '.github/workflows/dependencies.yml'
- '.github/workflows/rust.yml'
- '.mega-linter.yml'
- '.pre-commit-config.yaml'
- 'Cargo.toml'
- 'Docs/Docs/index.md'
- 'Docs/Docs/install.md'
- 'Makefile'
- 'Tools/clean.py'
- 'Translations/de.json'
- 'Translations/en.json'
- 'justfile'
- 'src/Lexer/lexer.rs'
- 'src/Lexer/mod.rs'
- 'src/Parser/parser.rs'
- 'src/compiler/compiler.rs'
- 'src/compiler/mod.rs'
- 'src/grammar/fileextensions'
- 'src/grammar/grammar.pest'
- 'src/grammar/grammar.rs'
- 'src/grammar/grammar_beta.pest'
- 'src/grammar/mod.rs'
- 'src/installer/Linux/installer.bash'
- 'src/installer/Windows/Server/installer.bat'
- 'src/installer/Windows/add_desktop_icon.bat'
- 'src/installer/Windows/add_to_path.bat'
- 'src/installer/Windows/associate_file_extension.bat'
- 'src/installer/Windows/setup.iss'
- 'src/installer/Windows/unasociate_file_extension.bat'
- 'src/lib.rs'
- 'src/main.rs'
- 'src/parser/convert.rs'
- 'src/parser/errors.rs'
- 'src/parser/mod.rs'
- 'src/parser/parser.rs'
- 'src/parser/token.rs'


Approved by: @


Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
Co-authored-by: ElBe <90863907+ElBe-Plaq@users.noreply.github.com>
  • Loading branch information
3 people committed Sep 20, 2023
2 parents 854612f + 3ff8fcd commit a0aa302
Show file tree
Hide file tree
Showing 41 changed files with 1,084 additions and 1,049 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ insert_final_newline = true
tab_width = 4
trim_trailing_whitespace = true

[*.{html,md,py,rs}]
[*.{html,md,py,rs,json}]
indent_size = 4
indent_style = space

Expand Down
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Please do **not** report an issue of pull request if the issue is a security vul
There is a different way to report such issues. Issues or pull requests about a vulnerability will be removed.

<div style="text-align: center">
<h4>Report vulnerabilities <a href="https://github.com/I-Language-Development/I-language/security/advisories/new">here</a></h4>
<h4>Report vulnerabilities <a href="https://github.com/I-Language-Development/I-language-rust/security/advisories/new">here</a></h4>
</div>

## Contributing
Expand Down
4 changes: 4 additions & 0 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ output("Hello world!");

That's it! It's literally so easy.

## Contact

To contact us, get help or just chat with others, you can visit [our discord server](https://discord.gg/JVyyDukQqV).

## Contributing

To contribute to this project, read the [contributing guide](CONTRIBUTING.md).
5 changes: 1 addition & 4 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| --------------- | ----------------------------------- |
| `v1.0.0-alpha1` | :x: (End of support) |
Expand All @@ -15,5 +12,5 @@ currently being supported with security updates.

To report a vulnerability, go to [our discord server](https://discord.gg/JVyyDukQqV), write an
[E-Mail](mailto:elbe.dev.plaq@gmail.com) or report it via
[GitHubs security reporting system](https://github.com/I-Language-Development/I-language/security/advisories/new)
[GitHubs security reporting system](https://github.com/I-Language-Development/I-language-rust/security/advisories/new)
(preferred).
4 changes: 2 additions & 2 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
You can get support on:

- [our discord server](https://discord.gg/JVyyDukQqV)
- [GitHub discussions](https://github.com/I-Language-Development/I-language/discussions)
- [GitHub issues](https://github.com/I-Language-Development/I-language/issues)
- [GitHub discussions](https://github.com/I-Language-Development/I-language-rust/discussions)
- [GitHub issues](https://github.com/I-Language-Development/I-language-rust/issues)
18 changes: 14 additions & 4 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ permissions: read-all

on:
push:
paths: ["dev-requirements.txt", "Docs/.requirements.txt"]
paths: ["dev-requirements.txt", "Docs/.requirements.txt", "Cargo.toml"]

pull_request:
paths: ["dev-requirements.txt", "Docs/.requirements.txt"]
paths: ["dev-requirements.txt", "Docs/.requirements.txt", "Cargo.toml"]

jobs:
install-dependencies:
install-python-dependencies:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -25,7 +25,17 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r dev-requirements.txt
pip install -r Docs/requirements.txt
pip install -r Docs/.requirements.txt
install-rust-dependencies:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies from Cargo.toml
run: cargo update
- name: Install dev-dependencies from Cargo.toml
run: cargo test --no-run
# ^ This is the only way to install dev-dependencies

dependency-review:
runs-on: ubuntu-latest
steps:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Rust
permissions: read-all

on: [push, pull_request]

env:
CARGO_TERM_COLOR: always

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
2 changes: 2 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ DISABLE_ERRORS_LINTERS:
- MARKDOWN_MARKDOWN_LINK_CHECK
- REPOSITORY_DUSTILOCK # cspell:disable-line
- JAVASCRIPT_STANDARD
- REPOSITORY_TRUFFLEHOG # cspell:disable-line
- SPELL_LYCHEE
FILTER_REGEX_EXCLUDE: .*mypy.* # cspell:disable-line
EDITORCONFIG_EDITORCONFIG_CHECKER_FILTER_REGEX_EXCLUDE: "Docs/acknowledgements.md|src/Installer/Linux/installer.bash"
REPORT_OUTPUT_FOLDER: none
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repos:
- id: check-toml
- id: check-yaml
- id: pretty-format-json
args: [--autofix]
args: [--autofix, --indent=4]
- id: requirements-txt-fixer
- id: trailing-whitespace
- repo: https://github.com/jorisroovers/gitlint
Expand Down
18 changes: 15 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[package]
name = "I-Language-Rust"
description = "The I programming language is a high level programming language written in rust."
version = "1.0.0-alpha2"
version = "1.0.0-alpha3"
authors = [
"ElBe-Plaq <elbe.dev.plaq@gmail.com>",
"MasterOktagon",
Expand All @@ -16,12 +16,24 @@ documentation = "https://i-language.readthedocs.io/"
readme = ".github/README.md"
homepage = "https://i-language-development.github.io/"
repository = "https://github.com/I-Language-Development/I-language-rust/"
license-file = "LICENSE"
license-file = "LICENSE.txt"
keywords = ["i", "i-language", "programming-language", "language", "compiler"]
categories = [
"compilers",
"development-tools",
]

[dependencies]
# None
pest = "2.7.3"
pest_derive = "2.7.3"
localizer-rs = "1.1.1"
current_locale = "0.1.1"

[dev-dependencies]
check = "1.0.0"
fmt = "0.1.0"
just = "1.14.0"
pest_fmt = "0.2.4"

[features]
beta = []
4 changes: 4 additions & 0 deletions Docs/Docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ output("Hello world!");

That's it! It's literally so easy.

## Contact

To contact us, get help or just chat with others, you can visit [our discord server](https://discord.gg/JVyyDukQqV).

## Contributing

To contribute to this project, read the [contributing guide](CONTRIBUTING.md).
2 changes: 1 addition & 1 deletion Docs/Docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ To install the I programming language follow the instructions below:
1. Navigate to the [latest release](https://github.com/I-Language-Development/I-language-rust/releases/latest).
2. Download the installer for your operating system. For windows it is `installer.exe`, for windows server it is `installer.bat` and for linux it is `installer.bash`.
3. Execute the installer.
4. After a restart, the I programming language should be installed properly. If this is not the case, report a new issue [here](https://github.com/I-Language-Development/I-language-rust/issues/new/choose).
4. After a restart, the I programming language should be installed properly. If this is not the case, report a new issue [here](https://github.com/I-Language-Development/I-language-rust/issues).

!!! info
Pre-releases may not work properly. Please create an [issue](https://github.com/I-Language-Development/I-language-rust/issues) when an error occurs. You may prefer to use stable releases.
24 changes: 0 additions & 24 deletions Makefile

This file was deleted.

37 changes: 0 additions & 37 deletions Tools/clean.py

This file was deleted.

4 changes: 4 additions & 0 deletions Translations/de.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"parser.convert.unknown_token": "{{color.yellow}}Warnung:{{end}} Unbekannter Token ({{token}}) gefunden. Token wird \u00fcbersprungen, da kein Syntaxfehler vorliegt...",
"parser.errors.syntax": "{{color.red}}Fehler:{{end}} Falsche Syntax"
}
4 changes: 4 additions & 0 deletions Translations/en.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"parser.convert.unknown_token": "{{color.yellow}}Warning:{{end}} Unknown token ({{token}}) detected. Skipping, due to no syntax error...",
"parser.errors.syntax": "{{color.red}}Error:{{end}} Invalid syntax"
}
26 changes: 26 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
alias b := build
alias c := clean
alias l := lint
alias r := run
alias t := test

# Compiles the rust source files
build *ARGUMENTS:
cargo build --release *ARGUMENTS

# Removes temporary files
clean:
rm -rf target
rm -rf Tools/__pycache__

# Lints the rust source files
lint *ARGUMENTS:
cargo check *ARGUMENTS

# Compiles and executes the main.rs file
run *ARGUMENTS:
cargo run *ARGUMENTS

# Runs the unittests
test *ARGUMENTS:
cargo test *ARGUMENTS
Loading

0 comments on commit a0aa302

Please sign in to comment.