Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
i7
peregrine
Commits
bfddd560
Commit
bfddd560
authored
Jul 09, 2014
by
Philipp Meyer
Browse files
Fixed parsing and display of parentheses
parent
1cca0e05
Changes
2
Hide whitespace changes
Inline
Side-by-side
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