|
@@ -1324,8 +1324,6 @@ type
|
|
// Convert declarations
|
|
// Convert declarations
|
|
Function ConvertElement(El : TPasElement; AContext: TConvertContext) : TJSElement; virtual;
|
|
Function ConvertElement(El : TPasElement; AContext: TConvertContext) : TJSElement; virtual;
|
|
Function ConvertProperty(El: TPasProperty; AContext: TConvertContext ): TJSElement; virtual;
|
|
Function ConvertProperty(El: TPasProperty; AContext: TConvertContext ): TJSElement; virtual;
|
|
- Function ConvertCommand(El: TPasImplCommand; AContext: TConvertContext): TJSElement; virtual;
|
|
|
|
- Function ConvertCommands(El: TPasImplCommands; AContext: TConvertContext): TJSElement; virtual;
|
|
|
|
Function ConvertConst(El: TPasConst; AContext: TConvertContext): TJSElement; virtual;
|
|
Function ConvertConst(El: TPasConst; AContext: TConvertContext): TJSElement; virtual;
|
|
Function ConvertDeclarations(El: TPasDeclarations; AContext: TConvertContext): TJSElement; virtual;
|
|
Function ConvertDeclarations(El: TPasDeclarations; AContext: TConvertContext): TJSElement; virtual;
|
|
Function ConvertExportSymbol(El: TPasExportSymbol; AContext: TConvertContext): TJSElement; virtual;
|
|
Function ConvertExportSymbol(El: TPasExportSymbol; AContext: TConvertContext): TJSElement; virtual;
|
|
@@ -7578,6 +7576,8 @@ Var
|
|
begin
|
|
begin
|
|
// NewEl is already added
|
|
// NewEl is already added
|
|
end
|
|
end
|
|
|
|
+ else if AContext.IsGlobal and (AContext.JSElement is TJSSourceElements) then
|
|
|
|
+ AddToSourceElements(TJSSourceElements(AContext.JSElement),NewEl)
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
AddToStatementList(SLFirst,SLLast,NewEl,PosEl);
|
|
AddToStatementList(SLFirst,SLLast,NewEl,PosEl);
|
|
@@ -9014,8 +9014,10 @@ begin
|
|
|
|
|
|
// create implementation declarations
|
|
// create implementation declarations
|
|
ImplDecl:=ConvertDeclarations(El.ImplementationSection,ImplContext);
|
|
ImplDecl:=ConvertDeclarations(El.ImplementationSection,ImplContext);
|
|
- if ImplDecl=nil then
|
|
|
|
- exit;
|
|
|
|
|
|
+ if ImplDecl<>nil then
|
|
|
|
+ RaiseInconsistency(20170910175032); // elements should have been added directly
|
|
|
|
+ if Src.Statements[Src.Statements.Count-1].Node=ImplVarSt then
|
|
|
|
+ exit; // no implementation
|
|
// add impl declarations
|
|
// add impl declarations
|
|
AddToSourceElements(Src,ImplDecl);
|
|
AddToSourceElements(Src,ImplDecl);
|
|
Result:=FunDecl;
|
|
Result:=FunDecl;
|
|
@@ -9917,15 +9919,6 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TPasToJSConverter.ConvertCommand(El: TPasImplCommand;
|
|
|
|
- AContext: TConvertContext): TJSElement;
|
|
|
|
-
|
|
|
|
-begin
|
|
|
|
- RaiseNotSupported(El,AContext,20161024192705);
|
|
|
|
- Result:=Nil;
|
|
|
|
- // ToDo: TPasImplCommand = class(TPasImplElement)
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
function TPasToJSConverter.ConvertIfStatement(El: TPasImplIfElse;
|
|
function TPasToJSConverter.ConvertIfStatement(El: TPasImplIfElse;
|
|
AContext: TConvertContext): TJSElement;
|
|
AContext: TConvertContext): TJSElement;
|
|
|
|
|
|
@@ -11632,15 +11625,6 @@ begin
|
|
}
|
|
}
|
|
end;
|
|
end;
|
|
|
|
|
|
-function TPasToJSConverter.ConvertCommands(El: TPasImplCommands;
|
|
|
|
- AContext: TConvertContext): TJSElement;
|
|
|
|
-
|
|
|
|
-begin
|
|
|
|
- RaiseNotSupported(El,AContext,20161024192806);
|
|
|
|
- Result:=Nil;
|
|
|
|
- // ToDo: TPasImplCommands = class(TPasImplElement)
|
|
|
|
-end;
|
|
|
|
-
|
|
|
|
function TPasToJSConverter.ConvertConst(El: TPasConst; AContext: TConvertContext
|
|
function TPasToJSConverter.ConvertConst(El: TPasConst; AContext: TConvertContext
|
|
): TJSElement;
|
|
): TJSElement;
|
|
// Important: returns nil if const was added to higher context
|
|
// Important: returns nil if const was added to higher context
|
|
@@ -11726,10 +11710,6 @@ begin
|
|
Result:=ConvertExportSymbol(TPasExportSymbol(El),AContext)
|
|
Result:=ConvertExportSymbol(TPasExportSymbol(El),AContext)
|
|
else if (C=TPasLabels) then
|
|
else if (C=TPasLabels) then
|
|
Result:=ConvertLabels(TPasLabels(El),AContext)
|
|
Result:=ConvertLabels(TPasLabels(El),AContext)
|
|
- else if (C=TPasImplCommand) then
|
|
|
|
- Result:=ConvertCommand(TPasImplCommand(El),AContext)
|
|
|
|
- else if (C=TPasImplCommands) then
|
|
|
|
- Result:=ConvertCommands(TPasImplCommands(El),AContext)
|
|
|
|
else if (C=TPasImplLabelMark) then
|
|
else if (C=TPasImplLabelMark) then
|
|
Result:=ConvertLabelMark(TPasImplLabelMark(El),AContext)
|
|
Result:=ConvertLabelMark(TPasImplLabelMark(El),AContext)
|
|
else if C.InheritsFrom(TPasExpr) then
|
|
else if C.InheritsFrom(TPasExpr) then
|