Skip to content

Commit

Permalink
Merge pull request #67 from consultingwerk/feature/SCL-4054
Browse files Browse the repository at this point in the history
Feature/scl 4054
  • Loading branch information
lutz-fechner authored Apr 13, 2023
2 parents a1b81a0 + c7dd9b5 commit 3796bd2
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 2 deletions.
11 changes: 11 additions & 0 deletions .project
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,15 @@
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
</natures>
<filteredResources>
<filter>
<id>1681401982016</id>
<name></name>
<type>30</type>
<matcher>
<id>org.eclipse.core.resources.regexFilterMatcher</id>
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
</matcher>
</filter>
</filteredResources>
</projectDescription>
4 changes: 2 additions & 2 deletions build.number
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#Build Number for ANT. Do not edit!
#Wed Mar 15 13:59:34 CET 2023
build.number=3
#Thu Apr 13 18:03:49 CEST 2023
build.number=4
Binary file modified proparse.assemblies.zip
Binary file not shown.
Binary file modified proparse.jar
Binary file not shown.
Binary file modified proparse.java.zip
Binary file not shown.
Binary file modified proparse.net.dll
Binary file not shown.
2 changes: 2 additions & 0 deletions src/com/joanju/proparse/Postlexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,8 @@ ProToken defined() throws IOException {
throwMessage("Bad DEFINED function in &IF preprocessor condition");
ProToken argToken = lexer.getAmpIfDefArg();
getNextToken();
if (currToken.getType() == MAKROREFERENCE)
getNextToken();
if (currToken.getType() != RIGHTPAREN)
throwMessage("Bad DEFINED function in &IF preprocessor condition");
return new ProToken(filenameList, NUMBER, prepro.defined(argToken.getText().trim().toLowerCase()));
Expand Down
33 changes: 33 additions & 0 deletions src/test/SCL4054/TestParseIfDefined.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package test.SCL4054;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;

import junit.framework.Assert;

import org.prorefactor.refactor.RefactorException;
import org.prorefactor.treeparser.ParseUnit;

import test.ProparseTestCase;

public class TestParseIfDefined extends ProparseTestCase {

public void setUp () throws Exception {
super.setUp();
}

public void test () throws RefactorException, IOException {
File original;
ParseUnit pu;
byte[] originalText;
byte[] nodeText;

original = new File ("src/test/SCL4054/testCode.p");

pu = new ParseUnit (original, "ISO8859-1");
Assert.assertNotNull(pu);
pu.treeParser01();
Assert.assertNotNull(pu.getTopNode());
}
}
21 changes: 21 additions & 0 deletions src/test/SCL4054/testCode.p
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* *************************** Definitions ************************** */

BLOCK-LEVEL ON ERROR UNDO, THROW.

&SCOPED-DEFINE Test 42

&SCOPED-DEFINE Test-42

&IF DEFINED (Test-42) NE 0 &THEN
MESSAGE "bam"
VIEW-AS ALERT-BOX.
&ENDIF


&IF DEFINED (Test-{&Test}) NE 0 &THEN
MESSAGE "yeah"
VIEW-AS ALERT-BOX.
&ENDIF

MESSAGE "boah"
VIEW-AS ALERT-BOX.

0 comments on commit 3796bd2

Please sign in to comment.