Skip to content
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
7 changes: 3 additions & 4 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ env:
jobs:
build-java:
name: Build Java
runs-on: ubuntu-latest
runs-on: ubuntu-26.04

outputs:
branch-exists-lara-framework: ${{ steps.Branch-lara-framework.outputs.value }}
Expand Down Expand Up @@ -142,9 +142,8 @@ jobs:
strategy:
fail-fast: false
matrix:
#node-version: ['latest', '22.x', '20.x']
node-version: ['22.x', '20.x']
os: [ubuntu-latest, windows-2022, macos-latest]
node-version: ['22.x']
os: [ubuntu-26.04, windows-2022, macos-latest]

runs-on: ${{ matrix.os }}

Expand Down
2 changes: 1 addition & 1 deletion Fortran-JS/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@specs-feup/metafor",
"version": "22.1.0",
"version": "22.2.0",
"description": "A Fortran source-to-source compiler written in Typescript",
"type": "module",
"files": [
Expand Down
31 changes: 30 additions & 1 deletion Fortran-JS/src-api/Joinpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ type PrivateMapper = {
"ProgramUnit": typeof ProgramUnit,
"RangeLoopControl": typeof RangeLoopControl,
"RealLiteral": typeof RealLiteral,
"SectionSubscript": typeof SectionSubscript,
"Statement": typeof Statement,
"StatementBlock": typeof StatementBlock,
"StringLiteral": typeof StringLiteral,
"Subroutine": typeof Subroutine,
"Subscript": typeof Subscript,
"UseStatement": typeof UseStatement,
"BinaryOperator": typeof BinaryOperator,
"Designator": typeof Designator,
Expand Down Expand Up @@ -443,6 +445,18 @@ export class RealLiteral extends Literal {
};
}

/**
* Represent a generic subscript for an array
*/
export class SectionSubscript extends Joinpoint {
/**
* @internal
*/
static readonly _defaultAttributeInfo: {readonly map?: DefaultAttributeMap, readonly name: string | null, readonly type?: PrivateMapper, readonly jpMapper?: typeof JoinpointMapper} = {
name: null,
};
}

/**
* Represents a Fortran statement
*/
Expand Down Expand Up @@ -486,6 +500,19 @@ export class Subroutine extends ProgramUnit {
get moduleName(): string { return wrapJoinPoint(this._javaObject.getModuleName()) }
}

/**
* Represent an integer subscript for an array
*/
export class Subscript extends SectionSubscript {
/**
* @internal
*/
static readonly _defaultAttributeInfo: {readonly map?: DefaultAttributeMap, readonly name: string | null, readonly type?: PrivateMapper, readonly jpMapper?: typeof JoinpointMapper} = {
name: null,
};
get expr(): Expr { return wrapJoinPoint(this._javaObject.getExpr()) }
}

export class UseStatement extends Statement {
/**
* @internal
Expand Down Expand Up @@ -786,7 +813,7 @@ export class ArraySubscriptExpr extends DataRef {
static readonly _defaultAttributeInfo: {readonly map?: DefaultAttributeMap, readonly name: string | null, readonly type?: PrivateMapper, readonly jpMapper?: typeof JoinpointMapper} = {
name: null,
};
get subscripts(): Expr[] { return wrapJoinPoint(this._javaObject.getSubscripts()) }
get subscripts(): SectionSubscript[] { return wrapJoinPoint(this._javaObject.getSubscripts()) }
get var(): DataRef { return wrapJoinPoint(this._javaObject.getVar()) }
}

Expand Down Expand Up @@ -815,10 +842,12 @@ const JoinpointMapper = {
programUnit: ProgramUnit,
rangeLoopControl: RangeLoopControl,
realLiteral: RealLiteral,
sectionSubscript: SectionSubscript,
statement: Statement,
statementBlock: StatementBlock,
stringLiteral: StringLiteral,
subroutine: Subroutine,
subscript: Subscript,
useStatement: UseStatement,
binaryOperator: BinaryOperator,
designator: Designator,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,8 @@ public OmpLoopConstruct ompLoopConstruct(DoConstruct doConstruct, List<OmpClause

OmpLoopConstruct newNode = new OmpLoopConstruct(data, clauses);

newNode.set(DoConstruct.LEADING_COMMENTS, List.of());

newNode.addChild(doConstruct);

return newNode;
Expand All @@ -252,6 +254,7 @@ public OmpLoopConstruct emptyOmpLoopConstruct() {
OmpLoopConstruct newNode = new OmpLoopConstruct(data, Collections.emptyList());

newNode.set(OmpLoopConstruct.KINDS, OmpDirectiveKind.getKinds("parallel do"));
newNode.set(OmpLoopConstruct.LEADING_COMMENTS, List.of());

return newNode;
}
Expand Down Expand Up @@ -292,6 +295,7 @@ public UseStmt useStmt(String moduleName) {
UseStmt newNode = new UseStmt(data, Collections.emptyList());

newNode.set(UseStmt.NAME, moduleName);
newNode.set(UseStmt.LEADING_COMMENTS, List.of());

return newNode;
}
Expand Down
6 changes: 5 additions & 1 deletion FortranWeaver/resources/fortran/weaverspecs/artifacts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<!-- ARRAY SUBSCRIPT -->
<artifact class="arraySubscriptExpr">
<attribute name="var" type="dataRef"/>
<attribute name="subscripts" type="expr[]"/>
<attribute name="subscripts" type="sectionSubscript[]"/>
</artifact>

<!-- COMPILER DIRECTIVE -->
Expand Down Expand Up @@ -189,4 +189,8 @@
<artifact class="entityDecl">
<attribute name="name" type="String"/>
</artifact>

<artifact class="subscript">
<attribute name="expr" type="expr"/>
</artifact>
</artifacts>
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,8 @@
<joinpoint class="elseIfStatement" tooltip="Represents the header of an 'else if' block"/>

<joinpoint class="elseBlock" tooltip="Represents the optional 'else' block of an if construct"/>

<joinpoint class="sectionSubscript" tooltip="Represent a generic subscript for an array"/>

<joinpoint class="subscript" tooltip="Represent an integer subscript for an array" extends="sectionSubscript"/>
</joinpoints>
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ public class FortranJoinpoints {
JOINPOINT_FACTORY.put(EntityDecl.class, FEntityDecl::new);
JOINPOINT_FACTORY.put(Initialization.class, FInitialization::new);
JOINPOINT_FACTORY.put(ExprInitialization.class, FExprInitialization::new);
JOINPOINT_FACTORY.put(Subscript.class, FSubscript::new);
JOINPOINT_FACTORY.put(SectionSubscript.class, FSectionSubscript::new);
JOINPOINT_FACTORY.put(FortranNode.class, FortranJoinpoints::defaultFactory);
}

Expand Down
Loading
Loading