Skip to content

Commit

Permalink
fix errant commits and fix for failing SET language test
Browse files Browse the repository at this point in the history
  • Loading branch information
reedeveris committed Apr 11, 2024
1 parent 7cecc65 commit 4c8ca89
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# This is created by bin/test/languages.bash. But should not be committed.
languages/

# PLCC places generated Java files in directories named Java. Ignore them.
Java/

# PLCC places generated Python files in directories named Python. Ignore them.
Python/

# Created by Docker environment
.bash_history

Expand Down
14 changes: 14 additions & 0 deletions bin/test/languages.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env bash

set -euo pipefail

LANGUAGES_VERSION="${LANGUAGES_VERSION:-}"
cd /tmp

rm -rf languages
git clone https://github.com/ourPLCC/languages.git
if [ -n "${LANGUAGES_VERSION}" ] ; then
git -C ./languages checkout "${LANGUAGES_VERSION}"
fi
languages/bin/test.bash
rm -rf languages
14 changes: 14 additions & 0 deletions docs/Developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,20 @@ bin/test/everything.bash
bin/test/functionality.bash
```

### Test languages

Check if our changes work with ourPLCC/languages:

```bash
bin/test/languages.bash
```

Test a specific version (git tag, branch, or commit hash) of ourPLCC/languages:

```bash
LANGUAGES_VESRION=v1.0.1 bin/test/languages.bash
```

### Test other things

To learn what other class of tests you can run...
Expand Down
15 changes: 8 additions & 7 deletions src/plcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,7 @@ def python_makeAbstractStub(base):
#{base}:top#
#{base}:import#
class {base}({ext}): #{base}:class#
class {base}({ext}): #{base}:class#
className = "{base}"
Expand Down Expand Up @@ -843,7 +843,7 @@ def python_makeStub(cls):
#{cls}:import#
# {ruleString}
class {cls}({ext}): #{cls}:class#
class {cls}({ext}): #{cls}:class#
className = "{cls}"
ruleString = "{ruleString}"
Expand Down Expand Up @@ -1101,7 +1101,7 @@ def sem(nxt):
deathLNO('no stub for class {} -- cannot replace //{}:{}//'.format(cls, cls, mod))
stubs[cls] = codeString
semFinishUp()


def getCode(nxt):
code = []
Expand Down Expand Up @@ -1130,10 +1130,11 @@ def getCode(nxt):
else:
deathLNO('premature end of file')
lineMode = False # switch off line mode
while len(code[0]) == 0:
code.pop(0)
while len(code[-1]) == 0:
code.pop()
if len(code)>0 :
while len(code[0]) == 0:
code.pop(0)
while len(code[-1]) == 0:
code.pop()
return code

def semFinishUp():
Expand Down

0 comments on commit 4c8ca89

Please sign in to comment.