Permalink
Browse files

Strict mode compiler in 11.7.3 (#334)

  • Loading branch information...
gquerret committed Jan 12, 2019
1 parent be3f853 commit ec7abbf13e8d43a190e4b484a1bbf84f03d37254
Showing with 10 additions and 12 deletions.
  1. +2 −2 build.xml
  2. +2 −2 src/java/com/phenix/pct/CompilationAttributes.java
  3. +6 −8 src/progress/pct/compile.p
@@ -183,7 +183,7 @@
<arg value="empty" />
<env key="DLC" value="${dlcHome}" />
</exec>
<bootstrapCompile destdir="${buildDir}" debugListing="true" listing="true" keepXref="true" xmlXref="${xmlxref}" md5="true" minSize="false" graphicalMode="false" dlcHome="${dlcHome}" includedPL="false" compileUnderscore="true" cpstream="utf-8" relativePaths="true" requireFullKeywords="true" requireFullNames="true" requireFieldQualifiers="true">
<bootstrapCompile destdir="${buildDir}" debugListing="true" listing="true" keepXref="true" xmlXref="${xmlxref}" md5="true" minSize="false" graphicalMode="false" dlcHome="${dlcHome}" includedPL="false" compileUnderscore="true" cpstream="utf-8" relativePaths="true" requireFullNames="true" requireFieldQualifiers="true">
<fileset refid="${fsid}" />
<propath refid="${propid}" />
<PCTRunOption name="-cprcodeout" value="undefined" />
@@ -245,7 +245,7 @@

<target name="classDoc" depends="declare-bootstrap" description="Windows compilation of class documentation">
<mkdir dir="${build-win}" />
<bootstrapCompile destdir="${build-win}" md5="true" minSize="false" graphicalMode="true" dlcHome="${DLC11}" includedPL="false" cpstream="iso8859-1" debugListing="true" listing="true" relativePaths="true" requireFullKeywords="true" requireFullNames="true" requireFieldQualifiers="true">
<bootstrapCompile destdir="${build-win}" md5="true" minSize="false" graphicalMode="true" dlcHome="${DLC11}" includedPL="false" cpstream="iso8859-1" debugListing="true" listing="true" relativePaths="true" requireFullNames="true" requireFieldQualifiers="true">
<fileset refid="fs.classDoc" />
<propath>
<pathelement location="${src.progress}" />
@@ -403,7 +403,7 @@ public int getFileList() {
}

protected void writeCompilationProcedure(File f, Charset c) {
boolean bAbove12 = parent.getVersion().compareTo(new DLCVersion(12, 0, "0")) >= 0;
boolean bAbove1173 = parent.getVersion().compareTo(new DLCVersion(11, 7, "3")) >= 0;
try (FileOutputStream fos = new FileOutputStream(f);
OutputStreamWriter osw = new OutputStreamWriter(fos, c);
BufferedWriter bw = new BufferedWriter(osw)) {
@@ -427,7 +427,7 @@ protected void writeCompilationProcedure(File f, Charset c) {
bw.write("DO ON STOP UNDO, RETRY: IF RETRY THEN DO: COMPILER:ERROR = TRUE. RETURN. END.");
bw.newLine();
bw.write("COMPILE VALUE(ipSrcFile) ");
if (bAbove12)
if (bAbove1173)
bw.write("OPTIONS ipOptions ");
if (isSaveR())
bw.write("SAVE INTO VALUE(ipSaveDir) ");
@@ -193,11 +193,11 @@ PROCEDURE initModule:
END.
COMPILER:MULTI-COMPILE = multiComp.
IF lOptFullKw THEN
ASSIGN cOpts = 'require-full-keywords' + (IF bAboveEq12 THEN ':warning' ELSE IF bAboveEq1173 THEN ':error' ELSE '').
ASSIGN cOpts = 'require-full-keywords' + (IF bAboveEq1173 THEN ':warning' ELSE '').
IF lOptFldQlf THEN
ASSIGN cOpts = cOpts + (IF cOpts EQ '' THEN '' ELSE ',') + 'require-field-qualifiers' + (IF bAboveEq12 THEN ':warning' ELSE IF bAboveEq1173 THEN ':error' ELSE '').
ASSIGN cOpts = cOpts + (IF cOpts EQ '' THEN '' ELSE ',') + 'require-field-qualifiers' + (IF bAboveEq1173 THEN ':warning' ELSE '').
IF lOptFullNames THEN
ASSIGN cOpts = cOpts + (IF cOpts EQ '' THEN '' ELSE ',') + 'require-full-names' + (IF bAboveEq12 THEN ':warning' ELSE IF bAboveEq1173 THEN ':error' ELSE '').
ASSIGN cOpts = cOpts + (IF cOpts EQ '' THEN '' ELSE ',') + 'require-full-names' + (IF bAboveEq1173 THEN ':warning' ELSE '').

IF ProgPerc GT 0 THEN DO:
ASSIGN iNrSteps = 100 / ProgPerc.
@@ -366,11 +366,9 @@ PROCEDURE compileXref.
ELSE
ASSIGN debugListingFile = ?.

/* Before 11.7.3, strict mode compiler was throwing errors. 11.7.3 introduced :warning and :error but that doesn't work
correctly, so we still stay with the old behavior. I expect OE 12 to fix this issue. */
/* them into warnings */
/* Before 11.7.3, strict mode compiler was throwing errors. 11.7.3 introduced :warning and :error */
&IF DECIMAL(SUBSTRING(PROVERSION, 1, INDEX(PROVERSION, '.') + 1)) GE 11.7 &THEN
IF (cOpts GT "") AND bAboveEq117 AND (NOT bAboveEq12) THEN DO:
IF (cOpts GT "") AND bAboveEq117 AND (NOT bAboveEq1173) THEN DO:
EMPTY TEMP-TABLE ttWarnings.
COMPILE VALUE(IF lRelative THEN ipInFile ELSE ipInDir + '/':U + ipInFile) SAVE=FALSE OPTIONS cOpts NO-ERROR.
IF COMPILER:ERROR THEN DO i = 1 TO COMPILER:NUM-MESSAGES:
@@ -391,7 +389,7 @@ correctly, so we still stay with the old behavior. I expect OE 12 to fix this is
RUN pctcomp.p (IF lRelative THEN ipInFile ELSE ipInDir + '/':U + ipInFile,
cSaveDir, debugListingFile,
IF Lst AND NOT LstPrepro THEN PCTDir + '/':U + ipInFile ELSE ?,
preprocessFile, cStrXrefFile, cXrefFile, IF bAboveEq12 THEN cOpts ELSE "").
preprocessFile, cStrXrefFile, cXrefFile, IF bAboveEq1173 THEN cOpts ELSE "").

ASSIGN opError = COMPILER:ERROR.
IF NOT opError THEN DO:

0 comments on commit ec7abbf

Please sign in to comment.