Skip to content

Commit

Permalink
Merge pull request #503 from dictu-lang/develop
Browse files Browse the repository at this point in the history
Release 0.23.0
  • Loading branch information
Jason2605 authored Dec 29, 2021
2 parents c518ecd + 035180a commit 4381290
Show file tree
Hide file tree
Showing 106 changed files with 2,703 additions and 287 deletions.
6 changes: 4 additions & 2 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

<!-- Link the issue below if you are resolving an issue !-->

Resolves:
Resolves: #

#

### Type of change:
Expand All @@ -42,6 +42,8 @@ Resolves:

- [ ] Documentation has been updated to reflect the changes done within this PR (if applicable).

#

### Preview (Screenshots) :

<!-- If applicable attempt to explain the screenshots !-->
44 changes: 11 additions & 33 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,53 +1,31 @@
\.idea/

build/

\.DS_Store

dictu

dictu\.dSYM/Contents/Info\.plist

test/
history\.txt

text\.txt

*.py
*.pyc

benchmark.sh

out.txt

time.du

test.du

coverage/

compile_commands.json

venv/

cmake-build-debug/CMakeFiles/clion-log.txt

docs/.jekyll-cache/
docs/_site/
cmake-build-debug/

cmake-build-release/

.vs/

dictu.exe

dictu.exe.manifest

CMakeSettings.json

dictu.ilk

dictu.pdb

docs/_site/
cmake-build-debug/
cmake-build-release/
.vs/
dictu.exe
dictu.exe.manifest
CMakeSettings.json
dictu.ilk
dictu.pdb
test1.du
\.vscode/
/.env
129 changes: 129 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our
community a harassment-free experience for everyone, regardless of age, body
size, visible or invisible disability, ethnicity, sex characteristics, gender
identity and expression, level of experience, education, socio-economic status,
nationality, personal appearance, race, religion, or sexual identity
and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming,
diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our
community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes,
and learning from the experience
* Focusing on what is best not just for us as individuals, but for the
overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or
advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email
address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of
acceptable behavior and will take appropriate and fair corrective action in
response to any behavior that they deem inappropriate, threatening, offensive,
or harmful.

Community leaders have the right and responsibility to remove, edit, or reject
comments, commits, code, wiki edits, issues, and other contributions that are
not aligned to this Code of Conduct, and will communicate reasons for moderation
decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when
an individual is officially representing the community in public spaces.
Examples of representing our community include using an official e-mail address,
posting via an official social media account, or acting as an appointed
representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported to the community leaders responsible for enforcement at
[emailing the project team][email].
All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the
reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining
the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed
unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing
clarity around the nature of the violation and an explanation of why the
behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series
of actions.

**Consequence**: A warning with consequences for continued behavior. No
interaction with the people involved, including unsolicited interaction with
those enforcing the Code of Conduct, for a specified period of time. This
includes avoiding interactions in community spaces as well as external channels
like social media. Violating these terms may lead to a temporary or
permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including
sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public
communication with the community for a specified period of time. No public or
private interaction with the people involved, including unsolicited interaction
with those enforcing the Code of Conduct, is allowed during this period.
Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community
standards, including sustained inappropriate behavior, harassment of an
individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within
the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage],
version 2.0, available at
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct
enforcement ladder](https://github.com/mozilla/diversity).

[homepage]: https://www.contributor-covenant.org
[email]: mailto:[email protected]

For answers to common questions about this code of conduct, see the FAQ at
https://www.contributor-covenant.org/faq. Translations are available at
https://www.contributor-covenant.org/translations.
4 changes: 2 additions & 2 deletions Docker/DictuAlpineDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ RUN cd Dictu \
&& cmake -DCMAKE_BUILD_TYPE=Release -B build \
&& cmake --build ./build \
&& ./dictu tests/runTests.du \
&& cp dictu /usr/bin/ \
&& rm -rf *
&& cp dictu /usr/bin/ \
&& rm -rf *

CMD ["dictu"]
8 changes: 4 additions & 4 deletions Docker/DictuUbuntuDockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ RUN apt-get update \
&& apt-get update \
&& apt-get install -y --reinstall ca-certificates \
&& apt-get install -y --no-install-recommends git cmake libcurl4-gnutls-dev \
&& rm -rf /var/lib/apt/lists/*
&& rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/dictu-lang/Dictu.git

RUN cd Dictu \
&& cmake -DCMAKE_BUILD_TYPE=Release -B build \
&& cmake --build ./build \
&& ./dictu tests/runTests.du \
&& cmake -DCMAKE_BUILD_TYPE=Release -B build \
&& cmake --build ./build \
&& ./dictu tests/runTests.du \
&& cp dictu /usr/bin/ \
&& rm -rf *

Expand Down
2 changes: 1 addition & 1 deletion docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: >-
color_scheme: "dictu" # Custom theme
logo: "/assets/images/dictu-logo/dictu-wordmark.svg"

version: "0.22.0"
version: "0.23.0"
github_username: dictu-lang
search_enabled: true

Expand Down
28 changes: 27 additions & 1 deletion docs/docs/classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,21 @@ print(myObject.getAttribute("y", 100)); // 100
print(myObject.getAttribute("y")); // nil
```

### getAttributes

The `getAttributes` method returns all public attributes on the given instance of a class.

```cs
class Test {
init() {
this.x = 10;
}
}

var myObject = Test();
print(myObject.getAttributes()); // ["x"]
```

### setAttribute

Similar concept to `getAttribute` however this allows us to set an attribute on an instance.
Expand Down Expand Up @@ -288,7 +303,18 @@ print(Test().someMethod()?.someOtherMethod()); // nil

// If the operand is not nil the method / property must exist
print(Test()?.unknownMethod()); // Undefined property 'unknownMethod'.
```
```
### _class
`_class` is a special attribute that is added to instances so that a reference to the class is kept on objects. This will be
useful for things like pulling class annotations from an object where it's class may be unknown until runtime.
```cs
class Test {}

print(Test()._class); // <Cls Test>
```
## Class variables
Expand Down
4 changes: 2 additions & 2 deletions docs/docs/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ If however you wish to import something specific from the module into the curren
accepts a single identifier or multiple separated by a comma.

```cs
from Math import PI;
from Math import pi;

PI; // 3.14...
pi; // 3.14...
// Import multiple things
from JSON import parse, stringify;
Expand Down
21 changes: 21 additions & 0 deletions docs/docs/standard-lib/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,24 @@ Env.set("key", "test");
Env.set("key", nil); // Remove env var
Env.set("key", 10); // set() arguments must be a string or nil.
```

### Env.readFile(string: path -> optional)

To read environment variables from a file this helper method is provided.
By default it will attempt to read `.env` unless a different path is supplied.
Returns a Result type and on success will unwrap to nil.

Note: You are able to have comments in the `.env` file via the use of `#` (both in-line and first character).

```env
# This is a comment
TEST=10
TESTING=100 # In-line comment
```

```cs
Env.readFile(); // <Result Suc>
print(Env.get("TEST")); // 10
print(Env.get("TESTING")); // 100
```
2 changes: 1 addition & 1 deletion docs/docs/standard-lib/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ parent: Standard Library

## HTTP

To make use of the HTTP module an import is required.
To make use of the HTTP module an import is required. Along with the methods described below, this module also defines constants representing all standard response codes and their associated messages, the standard set of HTTP methods, and common request headers and values.

```cs
import HTTP;
Expand Down
Loading

0 comments on commit 4381290

Please sign in to comment.