Commit 12062738 authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Fix error reporting of syntax errors in state aggregations

parent d95d7448
......@@ -142,8 +142,11 @@ The background pattern was downloaded from www.subtlepatterns.com
Changelog
=========
1.3.23 (05/2016)
- Fix reporting of syntax errors in state aggregations
1.3.22 (05/2016)
- Bux fix in range checks for division and subtraction
- Bug fix in range checks for division and subtraction
- Optimise loading when there are no CIF comments
1.3.21 (05/2016)
......
......@@ -2,7 +2,7 @@
 
# Resource object code
#
# Created: Sat Mar 26 10:12:49 2016
# Created: Tue May 17 16:27:03 2016
# by: The Resource Compiler for PySide (Qt v4.8.6)
#
# WARNING! All changes made in this file will be lost!
......@@ -117,7 +117,7 @@ except ImportError:
__all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse']
__version__ = '1.3.22'
__version__ = '1.3.23'
if hasattr(sys, 'frozen'):
# Detect if we are running on Windows (py2exe-generated)
......
This diff is collapsed.
This diff is collapsed.
......@@ -508,6 +508,11 @@ composite_state
| state_aggregation
;
// used for syntactic predicate
composite_state_preamble
: STATE AGGREGATION? statename end
SUBSTRUCTURE
;
composite_state_graph
: STATE statename e=end
......@@ -589,9 +594,13 @@ state_entry_exit_points
// 11.11.1 Composite State graph content (SDL2000)
// Use a syntactic predicate to disambiguate the parsing of the composite
// state vs a normal state, in the case of a syntax error in the composite.
composite_state_body
: (text_area | procedure | composite_state)*
start* (state | floating_label)*
: (text_area
| procedure
| (composite_state_preamble) =>composite_state)*
start* (state | floating_label)*
;
......
#!/usr/bin/env python
import opengeode
y=opengeode.ogParser.parser_init(string='''state ENTRYA;
# detect syntax errors (missing semi after "entry")
print('composite_state_body:')
test=opengeode.ogParser.parser_init(string=
'''state ENTRYA;
substructure
procedure entry EXTERNAL;
endsubstructure ENTRYA;''')
endsubstructure ENTRYA;
''')
y.composite_state_body()
test.composite_state_body()
z=opengeode.ogParser.parser_init(string='''state CHECKING;
print('composite_state:')
test=opengeode.ogParser.parser_init(string=
'''state CHECKING;
substructure
state ENTRYA;
substructure
......@@ -17,4 +27,26 @@ z=opengeode.ogParser.parser_init(string='''state CHECKING;
endsubstructure CHECKING;
''')
z.composite_state()
test.composite_state()
print('composite_state (should have no error)')
test=opengeode.ogParser.parser_init(string=
'''state CHECKING;
substructure
state ENTRYA;
endstate ENTRYA;
endsubstructure CHECKING;
''')
test.composite_state()
print('composite_state_body 2:')
test=opengeode.ogParser.parser_init(string=
'''state ENTRYA;
endstate;
''')
test.composite_state_body()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment