Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
peregrine
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
i7
peregrine
Commits
bfddd560
Commit
bfddd560
authored
Jul 09, 2014
by
Philipp Meyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed parsing and display of parentheses
parent
1cca0e05
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
src/Parser/PNET.hs
src/Parser/PNET.hs
+6
-4
src/Property.hs
src/Property.hs
+4
-4
No files found.
src/Parser/PNET.hs
View file @
bfddd560
...
...
@@ -137,9 +137,10 @@ termOperatorTable =
]
termAtom
::
Parser
Term
termAtom
=
parens
term
termAtom
=
(
Var
<$>
ident
)
<|>
(
Const
<$>
integer
)
<|>
(
Var
<$>
ident
)
<|>
parens
term
<?>
"basic term"
term
::
Parser
Term
term
=
buildExpressionParser
termOperatorTable
termAtom
<?>
"term"
...
...
@@ -167,10 +168,11 @@ formOperatorTable =
]
formAtom
::
Parser
Formula
formAtom
=
parens
formula
formAtom
=
try
linIneq
<|>
(
reserved
"true"
*>
return
FTrue
)
<|>
(
reserved
"false"
*>
return
FFalse
)
<|>
linIneq
<|>
parens
formula
<?>
"basic formula"
formula
::
Parser
Formula
formula
=
buildExpressionParser
formOperatorTable
formAtom
<?>
"formula"
...
...
src/Property.hs
View file @
bfddd560
...
...
@@ -20,10 +20,10 @@ data Term = Var String
instance
Show
Term
where
show
(
Var
x
)
=
x
show
(
Const
c
)
=
show
c
show
(
Minus
t
)
=
"-
("
++
show
t
++
")"
show
(
t
:+:
u
)
=
show
t
++
" + "
++
show
u
show
(
t
:-:
u
)
=
show
t
++
" - "
++
show
u
show
(
t
:*:
u
)
=
"("
++
show
t
++
") * ("
++
show
u
++
")"
show
(
Minus
t
)
=
"-
"
++
show
t
show
(
t
:+:
u
)
=
"("
++
show
t
++
" + "
++
show
u
++
")"
show
(
t
:-:
u
)
=
"("
++
show
t
++
" - "
++
show
u
++
")"
show
(
t
:*:
u
)
=
show
t
++
" * "
++
show
u
data
Op
=
Gt
|
Ge
|
Eq
|
Ne
|
Le
|
Lt
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment