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
2 changes: 1 addition & 1 deletion .github/workflows/build-release-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-pypi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Set up Python 3
uses: actions/setup-python@v4
with:
python-version: '3.10'
python-version: '3.x'
- name: Install pypa/build
run: python -m pip install build --user
- name: Build a binary wheel and a source tarball
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/run-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ['2.7', '3.10', 'pypy2.7', 'pypy3.8']
python-version: ['2.7', '3.x', 'pypy2.7', 'pypy3.9']
exclude:
# excludes pypy 3 on Windows
- os: windows-latest
python-version: 'pypy3.8'
python-version: 'pypy3.9'
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
Expand Down
6 changes: 3 additions & 3 deletions bridgepoint/oal.py
Original file line number Diff line number Diff line change
Expand Up @@ -968,17 +968,17 @@ def t_STRING(self, t):
return t

def t_END_FOR(self, t):
r"(?i)end[\s]+for"
r"[Ee][Nn][Dd][\s]+[Ff][Oo][Rr]"
t.endlexpos = t.lexpos + len(t.value)
return t

def t_END_IF(self, t):
r"(?i)end[\s]+if"
r"[Ee][Nn][Dd][\s]+[Ii][Ff]"
t.endlexpos = t.lexpos + len(t.value)
return t

def t_END_WHILE(self, t):
r"(?i)end[\s]+while"
r"[Ee][Nn][Dd][\s]+[Ww][Hh][Ii][Ll][Ee]"
t.endlexpos = t.lexpos + len(t.value)
return t

Expand Down
26 changes: 26 additions & 0 deletions tests/test_bridgepoint/test_foreach.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,32 @@ def test_for_each_loop(self):
o_obj = one(act_for).O_OBJ[670]()
self.assertEqual(o_obj.Key_Lett, 'A')

@prebuild_docstring
def test_mixed_casing_in_end_for(self):
'''
create object instance of A;
create object instance of A;
select many a_set from instances of A;
for each a in a_set
eNd FoR;
'''
act_for = self.metamodel.select_one('ACT_FOR')
self.assertTrue(act_for.is_implicit)

act_smt = one(act_for).ACT_SMT[603]()
self.assertIsNotNone(act_smt)

act_blk = one(act_for).ACT_BLK[605]()
self.assertIsNotNone(act_blk)

v_var = one(act_for).V_VAR[614]()
self.assertEqual(v_var.Name, 'a')

v_var = one(act_for).V_VAR[652]()
self.assertEqual(v_var.Name, 'a_set')

o_obj = one(act_for).O_OBJ[670]()
self.assertEqual(o_obj.Key_Lett, 'A')

if __name__ == "__main__":
import logging
Expand Down
26 changes: 26 additions & 0 deletions tests/test_bridgepoint/test_ifs.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,33 @@ def test_single_if_true(self):

act_e = one(act_if).ACT_E[683]()
self.assertIsNone(act_e)

@prebuild_docstring
def test_mixed_casing_in_end_if(self):
'''
if ( 0 == 0 ) then
return 1;
eNd If;
return 0;
'''
act_if = self.metamodel.select_one('ACT_IF')
self.assertIsNotNone(act_if)

act_smt = one(act_if).ACT_SMT[603]()
self.assertIsNotNone(act_smt)

v_val = one(act_if).V_VAL[625]()
self.assertIsNotNone(v_val)

act_blk = one(act_if).ACT_BLK[607]()
self.assertIsNotNone(act_blk)

act_el = many(act_if).ACT_EL[682]()
self.assertEqual(len(act_el), 0)

act_e = one(act_if).ACT_E[683]()
self.assertIsNone(act_e)

@prebuild_docstring
def test_elif(self):
'''
Expand Down
21 changes: 21 additions & 0 deletions tests/test_bridgepoint/test_while.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,27 @@ def test_while(self):
act_blk = one(act_whl).ACT_BLK[608]()
self.assertIsNotNone(act_blk)

@prebuild_docstring
def test_mixed_casing_in_end_while(self):
'''
assign x = 10;
while (x > 0)
assign x = x - 1;
EnD WhIlE;
return x;
'''
act_whl = self.metamodel.select_one('ACT_WHL')
self.assertIsNotNone(act_whl)

act_smt = one(act_whl).ACT_SMT[603]()
self.assertIsNotNone(act_smt)

v_val = one(act_whl).V_VAL[626]()
self.assertIsNotNone(v_val)

act_blk = one(act_whl).ACT_BLK[608]()
self.assertIsNotNone(act_blk)

@prebuild_docstring
def test_while_loop(self):
'''
Expand Down