Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Iteration29 (#677) #678

Merged
merged 1 commit into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/msbuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ env:
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release

BUILD_TAG: 6.2.2
BUILD_TAG: 6.2.3

permissions:
contents: read
Expand Down
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,36 @@
- [ADDED] #265 : Support enumeration list
- [ADDED] self attribute
- [ADDED] new operator $size
- [ADDED] text blocks
- [ADDED] method reference - &myMethod
- [FIXED] single dispatcher : if an argument is nillable, it can accept nil value
- [ADDED] String interpolation

- ELC
- [FIXED] private constructor must be called directly
- [FIXED] accessing static fields inside a structure
- [FIXED] ppc64le : decoratorTest()
- [FIXED] #667 : Boxing the symbol expression
- [FIXED] only public classes can be loaded in run-time
- [ADDED] #637 : bt optimization 4 unit test
- [FIXED] var attribute is allowed to be in the method argument list

- VM
- [FIXED] GC_ALLOC routine for vm mode

- RT

- SM
- [ADDED] CF : alternative output

- API
- [ADDED] reusing PermVectorTable after windows are closed
- [ADDED] xforms60 script
- [FIXED] external calls to be excluded from managed stack frames
- [FIXED] Directory.getFiles : raising an exception if no files were found

- SAMPLES
- [ADDED] xforms example

- Tools
- [ADDED] #658 : new project LDBG - ELENA Debugger Adapter
Expand Down
2 changes: 1 addition & 1 deletion build/aarch64/build_package_arm64.script
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
RELEASE=elena-6.2.2.aarch64-linux
RELEASE=elena-6.2.3.aarch64-linux

mkdir -p /usr/share/elena
mkdir -p /etc/elena/
Expand Down
2 changes: 1 addition & 1 deletion build/aarch64/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: elena-lang
Version: 6.2.2
Version: 6.2.3
Architecture: aarch64
Maintainer: Alex Rakov <[email protected]>
Depends: libc6 (>= 2.1)
Expand Down
2 changes: 1 addition & 1 deletion build/amd64/build_package_amd64.script
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
RELEASE=elena-6.2.2.amd64-linux
RELEASE=elena-6.2.3.amd64-linux

mkdir -p /usr/share/elena
mkdir -p /etc/elena/
Expand Down
2 changes: 1 addition & 1 deletion build/amd64/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: elena-lang
Version: 6.2.2
Version: 6.2.3
Architecture: amd64
Maintainer: Alex Rakov <[email protected]>
Depends: libc6 (>= 2.1)
Expand Down
2 changes: 1 addition & 1 deletion build/elena_inno.iss
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{3CAA69D3-0F98-44B1-A73E-E864BA51D5BD}
AppName=ELENA Programming Language
AppVersion=6.2.2
AppVersion=6.2.3
;AppVerName=ELENA Programming Language 6.2.0
AppPublisher=Alexey Rakov
AppPublisherURL=http://github.com/ELENA-LANG/elena-lang
Expand Down
2 changes: 1 addition & 1 deletion build/i386/build_package_i386.script
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
RELEASE=elena-6.2.2.i386-linux
RELEASE=elena-6.2.3.i386-linux

mkdir -p /usr/share/elena
mkdir -p /etc/elena/
Expand Down
2 changes: 1 addition & 1 deletion build/i386/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: elena-lang
Version: 6.2.2
Version: 6.2.3
Architecture: i386
Maintainer: Alex Rakov <[email protected]>
Depends: libc6 (>= 2.1)
Expand Down
2 changes: 1 addition & 1 deletion build/ppc64le/build_package_ppc64le.script
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
RELEASE=elena-6.2.2.ppc64le-linux
RELEASE=elena-6.2.3.ppc64le-linux

mkdir -p /usr/share/elena
mkdir -p /etc/elena/
Expand Down
2 changes: 1 addition & 1 deletion build/ppc64le/control
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: elena-lang
Version: 6.2.2
Version: 6.2.3
Architecture: ppc64le
Maintainer: Alex Rakov <[email protected]>
Depends: libc6 (>= 2.1)
Expand Down
83 changes: 82 additions & 1 deletion dat/sg/syntax60.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ __define wide 12300;
__define constant 12301;
__define long 12302;
__define real 12303;
__define nullable 12304;
__define interpolate 12304;

__define DECLARATION 5120;
__define BLOCK 7184;
Expand Down Expand Up @@ -101,8 +101,10 @@ __define L3_SINGLE_EXPRESSION 6298;
__define NESTED_ROOT_EXPRESSION 6299;
__define OPERATION_TEMPLATE 6300;
__define LT_EXPRESSION 6301;
__define INTERPOL_EXPRESSION 6302;
__define KEY_VALUE_EXPRESSION 6305;
__define CLOSURE_OPERATION 6306;
__define INTERPOLATE_EXPR 6307;
__define SWITCH_OPTION 6353;
__define SWITCH_LAST_OPTION 6354;
__define SWITCH_CODE 6355;
Expand Down Expand Up @@ -535,6 +537,7 @@ EXPRESSION ::=
}
| { reference | global } ^OBJECT L2_OP* L3_OP* L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| { string | integer | hexinteger | long | real | constant | character | wide } ^OBJECT L_F
| interpolate { INTERPOL_EXPRESSION interpolate }+ ^INTERPOLATE_EXPR
| "!" EXPRESSION ^NOT_OPERATION
| "*" SINGLE_EXPRESSION ^VALUE_OPERATION L2_OP* L3_OP* L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| "&" SINGLE_EXPRESSION ^CLOSURE_OPERATION L2_OP* L3_OP* L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
Expand All @@ -560,6 +563,84 @@ EXPRESSION ::=
}
| "$lazy" EXPRESSION ^LAZY_OPERATION;

INTERPOL_EXPRESSION ::=
identifier {
identifier+ {
{ DYNAMIC_DIMENSION ^ARRAY_TYPE }+ {
BRACKET ^OBJECT FUNCTION_R L3_OP* L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| "{" ^OBJECT COLLECTION "}" ^ COLLECTION_EXPRESSION L3_OP* L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
}
| SBRACKET ^OBJECT INDEXER_R
| BRACKET ^OBJECT FUNCTION_R
| DOT ^OBJECT MESSAGE ^PROPERTY_OPERATION
| L4_OOP L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| L5_OOP L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| L6_OOP L7_OP* L8_OP? L9_OP?
| L7_OOP L7_OP* L8_OP? L9_OP?
| IF ^OBJECT IF_R
| ELSE ^OBJECT ELSE_R
| L9_OOP
| LESS ^OBJECT TEMPLATE_ARG { "," TEMPLATE_ARG }* ">" ^TEMPLATE_TYPE {
"{" NESTED_EXPRESSION ^NESTED OL_F
| { DYNAMIC_DIMENSION ^ARRAY_TYPE }+ ^OBJECT BRACKET FUNCTION_R L3_OP* L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| SBRACKET ^OBJECT INDEXER_R OL_F
| BRACKET ^OBJECT FUNCTION_R OL_F
| L3_OOP L3_OP* L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| L4_OOP L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| L5_OOP L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| L6_OOP L7_OP* L8_OP? L9_OP?
| L7_OOP L7_OP* L8_OP? L9_OP?
| L8_OOP
| L9_OOP
}
| eps ^OBJECT
}
| reference {
SBRACKET ^OBJECT INDEXER_R
| L2_OOP L3_OP* L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| L3_OOP L3_OP* L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| L4_OOP L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| L5_OOP L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| L6_OOP L7_OP* L8_OP? L9_OP?
| L7_OOP L7_OP* L8_OP? L9_OP?
| L8_OOP
| L9_OOP
| eps ^OBJECT
}
| { DYNAMIC_DIMENSION ^ARRAY_TYPE }+ {
BRACKET FUNCTION_R L3_OP* L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| "{" ^OBJECT COLLECTION "}" ^ COLLECTION_EXPRESSION L3_OP* L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
}
| SBRACKET ^OBJECT INDEXER_R
| BRACKET ^OBJECT FUNCTION_R
| DOT ^OBJECT MESSAGE ^PROPERTY_OPERATION
| IF_DOT ^OBJECT MESSAGE? CALL_R ^IF_OPERATION ^OPERATION_TEMPLATE ^EXPRESSION OL_F
| ELSE_DOT ^OBJECT MESSAGE? CALL_R ^ELSE_OPERATION ^OPERATION_TEMPLATE ^EXPRESSION OL_F
| ALT_DOT ^OBJECT MESSAGE? CALL_R ^ALT_OPERATION ^OPERATION_TEMPLATE ^EXPRESSION OL_F
| L4_OOP L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| L5_OOP L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| L6_OOP L7_OP* L8_OP? L9_OP?
| LESS ^OBJECT L6_EXPRESSION ^LESS_OPERATION L7_OP* L8_OP? L9_OP?
| L7_OOP L7_OP* L8_OP? L9_OP?
| ELSE ^OBJECT ELSE_R
| L9_OOP
| { integer | hexinteger | long | real } ^OBJECT L_F
| eps ^OBJECT
}
| { reference | global } ^OBJECT L2_OP* L3_OP* L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| { integer | hexinteger | long | real } ^OBJECT L_F
| BRACKET SUB_EXPRESSION {
L2_OP+ L3_OP* L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| L3_OP+ L4_OP* L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| L4_OP+ L5_OP* L6_OP? L7_OP* L8_OP? L9_OP?
| L5_OP+ L6_OP? L7_OP* L8_OP? L9_OP?
| L6_OP L7_OP* L8_OP? L9_OP?
| L7_OP+ L8_OP? L9_OP?
| L8_OP
| L9_OP
| eps
};

SUB_EXPRESSION ::=
identifier {
identifier+ {
Expand Down
6 changes: 6 additions & 0 deletions doc/features
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,9 @@ public program()
{
myFunction()
}

----------------------------------------------------------------------------
String interpolation
----------------------------------------------------------------------------

var s := var s := $"a_{ 1 }_b_{ 2 }_c";
2 changes: 2 additions & 0 deletions doc/tech/bytecode60.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ ELENA byte codes (or ecodes)

lload dp:disp - long:index := dp[disp]

lload sp:i - long:index := sp[i]

load fp:i - index := fp[i]

load dp:disp - index := dp[disp]
Expand Down
28 changes: 7 additions & 21 deletions doc/todo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,22 @@ In development:
[development]
### EPIC: elena 6.3 ###

=== Iteration 28 (23.07) ===
--------------------------------------
- #637
--------------------------------------
- aarch64 : fix interfaceImplTests, decoratorTest

=== Iteration 29 ===
=== Iteration 30 (16.8) ===
--------------------------------------
dev:
- upndown (connector)
- web server - weather forecast (project setup)
- async programming
gen:
- nested call must not stop / start vm,
- lpad
maint:
- elena : nested classes should not be loadable at runtime
- constructor - single dispatcher; passing nil to single dispatcher (both normal / constructor)
port:
- #658 : create simplest debug adapter; connect with it from VSCode
- #658 : vscode extension (debug adapter)
prom: posting weekly
--------------------------------------
- lpad : generate a code based on a record
- User-defined string literals
--------------------------------------

=== Iteration 30 ===
--------------------------------------
dev:
gen:
maint:
port:
prom:
--------------------------------------
- #658 : connect with ldbg from VSCode
--------------------------------------

### EPIC: elena 6.4 ###
Expand Down
30 changes: 30 additions & 0 deletions elenasrc3/common/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,36 @@
#include <cstdlib>
#include <cstdint>

#if defined(_MSC_VER)
#define DISABLE_WARNING_PUSH __pragma(warning( push ))
#define DISABLE_WARNING_POP __pragma(warning( pop ))
#define DISABLE_WARNING(warningNumber) __pragma(warning( disable : warningNumber ))

#define DISABLE_WARNING_UNREFERENCED_FORMAL_PARAMETER DISABLE_WARNING(4100)
#define DISABLE_WARNING_UNREFERENCED_FUNCTION DISABLE_WARNING(4505)
#define DISABLE_WARNING_UNINITIALIZED_FIELD DISABLE_WARNING(26495)
// other warnings you want to deactivate...

#elif defined(__GNUC__) || defined(__clang__)
#define DO_PRAGMA(X) _Pragma(#X)
#define DISABLE_WARNING_PUSH DO_PRAGMA(GCC diagnostic push)
#define DISABLE_WARNING_POP DO_PRAGMA(GCC diagnostic pop)
#define DISABLE_WARNING(warningName) DO_PRAGMA(GCC diagnostic ignored #warningName)

#define DISABLE_WARNING_UNREFERENCED_FORMAL_PARAMETER DISABLE_WARNING(-Wunused-parameter)
#define DISABLE_WARNING_UNREFERENCED_FUNCTION DISABLE_WARNING(-Wunused-function)
#define DISABLE_WARNING_UNINITIALIZED_FIELD DISABLE_WARNING(-Wunused-function)
// other warnings you want to deactivate...

#else
#define DISABLE_WARNING_PUSH
#define DISABLE_WARNING_POP
#define DISABLE_WARNING_UNREFERENCED_FORMAL_PARAMETER
#define DISABLE_WARNING_UNREFERENCED_FUNCTION
// other warnings you want to deactivate...

#endif

namespace elena_lang
{

Expand Down
8 changes: 8 additions & 0 deletions elenasrc3/common/lists.h
Original file line number Diff line number Diff line change
Expand Up @@ -718,6 +718,8 @@ namespace elena_lang

int count_int() const { return (int)_list.count(); }

short count_short() const { return (short)_list.count(); }

Iterator start()
{
return _list.start();
Expand Down Expand Up @@ -3201,11 +3203,17 @@ namespace elena_lang
_allocatedSize = _length = 0;
}

DISABLE_WARNING_PUSH
DISABLE_WARNING_UNINITIALIZED_FIELD

CachedList()
{
_allocated = nullptr;
_allocatedSize = _length = 0;
}

DISABLE_WARNING_POP

~CachedList()
{
freeobj(_allocated);
Expand Down
26 changes: 23 additions & 3 deletions elenasrc3/elc/clicommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,9 @@ enum class ExpressionAttribute : pos64_t
RetrievingType = 0x00010000000,
RetValExpected = 0x00020000000,
CheckShortCircle = 0x00040000000,
LookaheadExprMode = 0x00080000000,
LookaheadExprMode = 0x00080000000,
Class = 0x00100000000,
Nillable = 0x00200000000,
OutRefOp = 0x01000000000,
WithVariadicArgCast = 0x02008000000,
DistributedForward = 0x04000000000,
Expand Down Expand Up @@ -764,8 +765,27 @@ enum class VirtualType : int
AbstractEmbeddableWrapper
};

typedef Pair<mssg_t, VirtualType, 0, VirtualType::None> VirtualMethod;
typedef List<VirtualMethod> VirtualMethodList;
struct VirtualMethod
{
mssg_t message;
VirtualType type;
int nillableArgs;

VirtualMethod()
{
message = 0;
type = VirtualType::None;
nillableArgs = 0;
}
VirtualMethod(mssg_t message, VirtualType type, int nillableArgs)
{
this->message = message;
this->type = type;
this->nillableArgs = nillableArgs;
}
};

typedef List<VirtualMethod> VirtualMethodList;

}

Expand Down
Loading
Loading