Skip to content

Commit 77a9897

Browse files
authored
Merge pull request #319 from Eclalang/main
merge main in staging for release
2 parents 42cf2ab + 6ae0b13 commit 77a9897

File tree

180 files changed

+17284
-4772
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+17284
-4772
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: "[BUG] : "
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Desktop (please complete the following information):**
27+
- OS: [e.g. Windows]
28+
- Version [e.g. 1.0.0]
29+
30+
**Additional content**
31+
Add any other informations about the problem you think might be helpful.
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: "[REQUEST] : "
5+
labels: feature request
6+
assignees: mkarten, tot0p
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Add a real world example (Optional)**
20+
Some code that describe the use of this feature in a real world situation
21+
22+
**Additional context**
23+
Add any other context or screenshots about the feature request here that might be helpful.

.github/ISSUE_TEMPLATE/help-needed.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: Help needed
3+
about: Need help ? This issue is for you
4+
title: "[HELP]"
5+
labels: help
6+
assignees: mkarten, tot0p
7+
8+
---
9+
10+
**Describe your problem**
11+
Describe your problem and how we can help you
12+
13+
**Additional context**
14+
Add any other context or screenshots that might be helpful.

.github/ISSUE_TEMPLATE/question.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
name: Question
3+
about: Any question about Ecla
4+
title: "[QUESTION] : "
5+
labels: question
6+
assignees: mkarten, tot0p
7+
8+
---
9+
10+
**Question Subject**
11+
Describe what is your question about
12+
13+
**How can we help**
14+
What do you need regarding your question
15+
16+
**Additional context**
17+
Add any other context or screenshots that might be helpful.

.github/workflows/ci.yml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Test and coverage
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v4
10+
- uses: actions/setup-go@v4
11+
with:
12+
go-version: 'stable'
13+
- name: Run coverage
14+
run: go test ./... -race -coverprofile=coverage.txt -covermode=atomic
15+
- name: Upload coverage reports to Codecov
16+
uses: codecov/codecov-action@v4.0.1
17+
with:
18+
token: ${{ secrets.CODECOV_TOKEN }}
19+
slug: Eclalang/Ecla

.github/workflows/static.yml

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ on:
44
push:
55
branches:
66
- 'main'
7-
87
jobs:
9-
pre-build:
8+
api:
109
environment:
1110
name: github-pages
1211
url: ${{ steps.deployment.outputs.page_url }}
@@ -21,8 +20,8 @@ jobs:
2120
python-version: '3.10'
2221
- run: mkdir dist
2322
- run: python actions/script.py
24-
- run: mv docs dist/docs
25-
- run: cp index.json dist/index.json
23+
# - run: mv docs dist/docs
24+
# - run: cp index.json dist/index.json
2625
- name: Setup Pages
2726
uses: actions/configure-pages@v3
2827
- name: Upload artifact

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,6 @@
1717
# Dependency directories (remove the comment below to include it)
1818
# vendor/
1919

20-
.vs
20+
.vs
21+
22+
test.ecla

CODE_OF_CONDUCT.md

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
eclalang.corp@gmail.com.
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

DEMO/AllTests.ecla

+108
Original file line numberDiff line numberDiff line change
@@ -506,3 +506,111 @@ function testfunc5(a : int, b: string) (string) {
506506
console.println(testfunc5(10,"hello"));
507507

508508
# ----------------------------------------------------------------------------------------------------------------
509+
510+
# test anonymous function
511+
# ----------------------------------------------------------------------------------------------------------------
512+
var testFunc function(int,int)(int) = function (a : int, b : int) (int) {
513+
return a + b;
514+
};
515+
516+
var testFunc2 function(int,int) = function (a : int, b : int) {
517+
console.println(a + b);
518+
};
519+
520+
521+
function (a : int, b : int) {
522+
console.println(a + b);
523+
}(1,1);
524+
525+
console.println(testFunc);
526+
527+
# ----------------------------------------------------------------------------------------------------------------
528+
529+
# test struct
530+
# ----------------------------------------------------------------------------------------------------------------
531+
532+
struct Test {
533+
test : string;
534+
}
535+
536+
# struct creation
537+
struct Point {
538+
539+
# simple fields
540+
x : int;
541+
y : int;
542+
543+
# function fields
544+
printSelf : function(Point);
545+
546+
# embedded structs
547+
test : Test;
548+
549+
intArray : [][]int;
550+
551+
stringMap : map[string]int
552+
}
553+
554+
function printSelf (p : Point) {
555+
console.println(p.test.test, p.y,p.x);
556+
}
557+
558+
function getPoint (p : Point) (Point ){
559+
return p;
560+
}
561+
562+
# instantiate a struct
563+
var p Point = Point{1, 2, printSelf, Test{"test"},[[1,2],[3,4]],{"douze" : 12, "onze" : 11}};
564+
565+
# access fields
566+
console.println(p.x, p.y);
567+
568+
# modify fields
569+
p.x = 3;
570+
p.y = 4;
571+
console.println(p.x, p.y);
572+
573+
p.intArray[0][0] = 12;
574+
575+
console.println(p.intArray[0][0]);
576+
577+
p.stringMap["onze"] = 78;
578+
579+
console.println(p.stringMap["onze"]);
580+
581+
582+
# access struct fields from value returned by function
583+
getPoint(p).printSelf(p);
584+
585+
# access struct fields from value in array
586+
var arr []Point = [p];
587+
console.println(arr[0].x, arr[0].y);
588+
589+
# access struct fields from value in map
590+
var m map[string]Point = {"p": p};
591+
console.println(m["p"].x, m["p"].y);
592+
593+
# call function fields
594+
p.printSelf(p);
595+
596+
# access embedded struct fields
597+
console.println(p.test.test);
598+
599+
600+
# ----------------------------------------------------------------------------------------------------------------
601+
602+
# test block
603+
# ----------------------------------------------------------------------------------------------------------------
604+
605+
var block string = "default";
606+
607+
{
608+
var block string = "working";
609+
console.print("this should print \"working\" : " );
610+
console.println(block);
611+
block = "modified";
612+
}
613+
console.print("this should print \"default\" : " );
614+
console.println(block);
615+
616+
# ----------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)