Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tla2bAST
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
general
stups
tla2bAST
Commits
6d45d150
Verified
Commit
6d45d150
authored
1 month ago
by
Miles Vella
Browse files
Options
Downloads
Patches
Plain Diff
Fix @generated comment in machine file header
parent
3f37c791
No related branches found
No related tags found
No related merge requests found
Pipeline
#157643
passed
1 month ago
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/tla2bAst/Translator.java
+8
-2
8 additions, 2 deletions
src/main/java/de/tla2bAst/Translator.java
with
8 additions
and
2 deletions
src/main/java/de/tla2bAst/Translator.java
+
8
−
2
View file @
6d45d150
...
@@ -37,6 +37,11 @@ import java.util.stream.Collectors;
...
@@ -37,6 +37,11 @@ import java.util.stream.Collectors;
import
static
de
.
tla2b
.
global
.
TranslationGlobals
.
VERSION_NUMBER
;
import
static
de
.
tla2b
.
global
.
TranslationGlobals
.
VERSION_NUMBER
;
public
class
Translator
{
public
class
Translator
{
/**
* This old header looks like the generated pragma which does not parse because of the text following it.
*/
private
static
final
String
GENERATED_BY_TLA2B_HEADER_OLD
=
"/*@ generated by TLA2B "
;
private
static
final
String
GENERATED_BY_TLA2B_HEADER
=
"/* @generated by TLA2B "
;
private
static
final
String
GENERATED_BY_TLA2B_HEADER
=
"/* @generated by TLA2B "
;
private
String
parentPath
;
private
String
parentPath
;
...
@@ -216,7 +221,8 @@ public class Translator {
...
@@ -216,7 +221,8 @@ public class Translator {
if
(
machineFile
.
exists
())
{
if
(
machineFile
.
exists
())
{
try
(
BufferedReader
in
=
new
BufferedReader
(
new
FileReader
(
machineFile
)))
{
try
(
BufferedReader
in
=
new
BufferedReader
(
new
FileReader
(
machineFile
)))
{
String
firstLine
=
in
.
readLine
();
String
firstLine
=
in
.
readLine
();
if
(
firstLine
!=
null
&&
!
firstLine
.
startsWith
(
GENERATED_BY_TLA2B_HEADER
))
{
boolean
generatedByTLA2B
=
firstLine
!=
null
&&
(
firstLine
.
startsWith
(
GENERATED_BY_TLA2B_HEADER_OLD
)
||
firstLine
.
startsWith
(
GENERATED_BY_TLA2B_HEADER
));
if
(!
generatedByTLA2B
)
{
System
.
err
.
println
(
"Error: File "
+
machineFile
.
getName
()
+
" already exists"
System
.
err
.
println
(
"Error: File "
+
machineFile
.
getName
()
+
" already exists"
+
" and was not generated by TLA2B.\n"
+
"Delete or move this file."
);
+
" and was not generated by TLA2B.\n"
+
"Delete or move this file."
);
System
.
exit
(-
1
);
System
.
exit
(-
1
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment