Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
sarah.grebing
ProofScriptParser
Commits
7ace485e
Commit
7ace485e
authored
Nov 10, 2017
by
Sarah Grebing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bugfix concerning " for stringliterals
parent
a730de1d
Pipeline
#15284
failed with stages
in 1 minute and 14 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
32 deletions
+32
-32
lang/src/main/java/edu/kit/iti/formal/psdbg/parser/PrettyPrinter.java
...n/java/edu/kit/iti/formal/psdbg/parser/PrettyPrinter.java
+27
-27
rt-key/src/main/java/edu/kit/iti/formal/psdbg/LabelFactory.java
.../src/main/java/edu/kit/iti/formal/psdbg/LabelFactory.java
+2
-2
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controls/ScriptArea.java
...ava/edu/kit/iti/formal/psdbg/gui/controls/ScriptArea.java
+3
-3
No files found.
lang/src/main/java/edu/kit/iti/formal/psdbg/parser/PrettyPrinter.java
View file @
7ace485e
...
...
@@ -138,6 +138,23 @@ public class PrettyPrinter extends DefaultASTVisitor<Void> {
return
null
;
}
@Override
public
Void
visit
(
StringLiteral
stringLiteral
)
{
s
.
append
(
String
.
format
(
"\'\'%s\'\'"
,
stringLiteral
.
getText
()));
return
super
.
visit
(
stringLiteral
);
}
/**
* clear line
*/
private
void
cl
()
{
int
i
=
s
.
length
()
-
1
;
while
(
Character
.
isWhitespace
(
s
.
charAt
(
i
)))
{
s
.
deleteCharAt
(
i
--);
}
nl
();
}
@Override
public
Void
visit
(
CasesStatement
casesStatement
)
{
s
.
append
(
"cases {"
);
...
...
@@ -154,10 +171,10 @@ public class PrettyPrinter extends DefaultASTVisitor<Void> {
s.append("}");
}*/
if
(
casesStatement
.
getDefCaseStmt
()
!=
null
)
{
s
.
append
(
"default
{
"
);
s
.
append
(
"default
:
"
);
casesStatement
.
getDefCaseStmt
().
accept
(
this
);
cl
();
s
.
append
(
"}"
);
//
s.append("}");
}
decrementIndent
();
...
...
@@ -166,28 +183,6 @@ public class PrettyPrinter extends DefaultASTVisitor<Void> {
return
null
;
}
/**
* clear line
*/
private
void
cl
()
{
int
i
=
s
.
length
()
-
1
;
while
(
Character
.
isWhitespace
(
s
.
charAt
(
i
)))
{
s
.
deleteCharAt
(
i
--);
}
nl
();
}
@Override
public
Void
visit
(
GuardedCaseStatement
caseStatement
)
{
s
.
append
(
"case "
);
caseStatement
.
getGuard
().
accept
(
this
);
s
.
append
(
" {"
);
caseStatement
.
getBody
().
accept
(
this
);
nl
();
s
.
append
(
"}"
);
return
super
.
visit
(
caseStatement
);
}
@Override
public
Void
visit
(
CallStatement
call
)
{
s
.
append
(
call
.
getCommand
());
...
...
@@ -206,9 +201,14 @@ public class PrettyPrinter extends DefaultASTVisitor<Void> {
}
@Override
public
Void
visit
(
StringLiteral
stringLiteral
)
{
s
.
append
(
String
.
format
(
"\"%s\""
,
stringLiteral
.
getText
()));
return
super
.
visit
(
stringLiteral
);
public
Void
visit
(
GuardedCaseStatement
caseStatement
)
{
s
.
append
(
"case "
);
caseStatement
.
getGuard
().
accept
(
this
);
s
.
append
(
": "
);
caseStatement
.
getBody
().
accept
(
this
);
nl
();
// s.append("}");
return
super
.
visit
(
caseStatement
);
}
@Override
...
...
rt-key/src/main/java/edu/kit/iti/formal/psdbg/LabelFactory.java
View file @
7ace485e
...
...
@@ -53,7 +53,7 @@ public class LabelFactory {
}
cur
=
cur
.
parent
();
}
while
(
cur
!=
null
);
sb
.
append
(
"
$$
"
);
sb
.
append
(
"
END
"
);
return
sb
.
toString
();
}
...
...
@@ -70,7 +70,7 @@ public class LabelFactory {
}
node
=
p
;
}
sb
.
append
(
"
$$
"
);
sb
.
append
(
"
END
"
);
return
sb
.
toString
();
}
...
...
ui/src/main/java/edu/kit/iti/formal/psdbg/gui/controls/ScriptArea.java
View file @
7ace485e
package
edu.kit.iti.formal.psdbg.gui.controls
;
import
com.google.common.eventbus.Subscribe
;
import
de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIcon
;
import
de.jensd.fx.glyphs.materialdesignicons.MaterialDesignIconView
;
import
de.uka.ilkd.key.logic.SequentFormula
;
import
edu.kit.iti.formal.psdbg.gui.controller.Events
;
import
edu.kit.iti.formal.psdbg.gui.model.MainScriptIdentifier
;
import
edu.kit.iti.formal.psdbg.interpreter.dbg.Breakpoint
;
...
...
@@ -11,7 +9,7 @@ import edu.kit.iti.formal.psdbg.lint.LintProblem;
import
edu.kit.iti.formal.psdbg.lint.LinterStrategy
;
import
edu.kit.iti.formal.psdbg.parser.Facade
;
import
edu.kit.iti.formal.psdbg.parser.ScriptLanguageLexer
;
import
edu.kit.iti.formal.psdbg.parser.ast.
*
;
import
edu.kit.iti.formal.psdbg.parser.ast.
ProofScript
;
import
javafx.beans.InvalidationListener
;
import
javafx.beans.Observable
;
import
javafx.beans.binding.BooleanBinding
;
...
...
@@ -201,7 +199,9 @@ public class ScriptArea extends CodeArea {
String
newValue
=
getText
();
if
(
newValue
.
length
()
!=
0
)
{
clearStyle
(
0
,
newValue
.
length
());
StyleSpans
<?
extends
Collection
<
String
>>
spans
=
highlighter
.
highlight
(
newValue
);
if
(
spans
!=
null
)
setStyleSpans
(
0
,
spans
);
markedRegions
.
forEach
(
reg
->
{
...
...
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