Skip to content

Commit

Permalink
Merge pull request #133 from BalticAmadeus/41-for-formatting
Browse files Browse the repository at this point in the history
41 FOR Formatting
  • Loading branch information
PauliusKu authored Sep 11, 2024
2 parents fbb7932 + 9c9869c commit 95f9e0f
Show file tree
Hide file tree
Showing 83 changed files with 898 additions and 227 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,11 @@
"default": "true",
"description": "Enable USING formatting"
},
"AblFormatter.emptyBlockFormatting": {
"AblFormatter.bodyFormatting": {
"order": 1000,
"type": "boolean",
"default": "true",
"description": "Enable EMPTY BLOCK formatting"
"description": "Enable BODY formatting"
},
"AblFormatter.propertyFormatting": {
"order": 1100,
Expand All @@ -202,7 +202,7 @@
"AblFormatter.ifFunctionFormattingAddParentheses": {
"order": 1201,
"type": "string",
"default": "Yes",
"default": "No",
"enum": [
"Yes",
"No"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* formatterSettingsOverride */
/* { "AblFormatter.blockFormatting": false}*/
/* { "AblFormatter.bodyFormatting": false,
"AblFormatter.forFormatting": false}*/

for each Customer no-lock:
Customer.var += 1.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* formatterSettingsOverride */
/* { "AblFormatter.blockFormatting": false}*/
/* { "AblFormatter.bodyFormatting": false,
"AblFormatter.forFormatting": false}*/

for each Customer no-lock:
Customer.var += 1.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* formatterSettingsOverride */
/* { "AblFormatter.blockFormatting": false}*/
/* { "AblFormatter.bodyFormatting": false,
"AblFormatter.forFormatting": false}*/

for each Customer no-lock:
Customer.var += 1.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* formatterSettingsOverride */
/* { "AblFormatter.blockFormatting": false}*/
/* { "AblFormatter.bodyFormatting": false,
"AblFormatter.forFormatting": false}*/

for each Customer no-lock:
Customer.var += 1.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* formatterSettingsOverride */
/* { "AblFormatter.blockFormatting": false}*/
/* { "AblFormatter.bodyFormatting": false,
"AblFormatter.forFormatting": false}*/

for each Customer no-lock:
Customer.var += 1.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* formatterSettingsOverride */
/* { "AblFormatter.blockFormatting": false}*/
/* { "AblFormatter.bodyFormatting": false,
"AblFormatter.forFormatting": false}*/

for each Customer no-lock:
Customer.var += 1.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

repeat:
define variable a as integer no-undo.
end.
end.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* formattersettingsoverride */
/* { "AblFormatter.blockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true,
"AblFormatter.forFormatting": false}*/

do transaction:
for each Customer no-lock:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* formattersettingsoverride */
/* { "AblFormatter.blockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true,
"AblFormatter.forFormatting": false}*/

do transaction:
for each Customer no-lock:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* formatterSettingsOverride */
/* { "AblFormatter.blockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true,
"AblFormatter.forFormatting": false}*/

for each A no-lock:
for each B no-lock where A.id = B.id:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* formatterSettingsOverride */
/* { "AblFormatter.blockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true,
"AblFormatter.forFormatting": false}*/

for each A no-lock:
for each B no-lock where A.id = B.id:
Expand Down
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/10finally/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

finally:
end finally.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/10finally/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

finally:
end finally.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/11for/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.forFormatting": true}*/

for each Customer by Customer.CreditLimit by Customer.Name:
end.
6 changes: 4 additions & 2 deletions resources/functionalTests/emptyBlock/11for/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.forFormatting": true}*/

for each Customer by Customer.CreditLimit by Customer.Name:
for each Customer
by Customer.CreditLimit
by Customer.Name:
end.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/12function/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

function fun returns integer ():

Expand Down
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/12function/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

function fun returns integer ():

Expand Down
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/13method/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

class Class final:
method public void mt():
Expand Down
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/13method/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

class Class final:
method public void mt():
Expand Down
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/14on_do/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

on choose of b_next, b_prev do:
end.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/14on_do/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

on choose of b_next, b_prev do:
end.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/15on1/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

ON F1 GO. /* F1 will now perform the GO function */
ON F2 HELP. /* F2 will now perform the HELP function */
Expand Down
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/15on1/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

ON F1 GO. /* F1 will now perform the GO function */
ON F2 HELP. /* F2 will now perform the HELP function */
Expand Down
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/16procedure/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

procedure proc:
end procedure.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/16procedure/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

procedure proc:
end procedure.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/17repeat/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

repeat:
end.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/17repeat/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

repeat:
end.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/1catch/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

catch oErr as MyErrorType:
end catch.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/1catch/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

catch oErr as MyErrorType:
end catch.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/2class/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

class A inherits B:
end class.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/2class/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

class A inherits B:
end class.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/3constructor/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

class A inherits B:
constructor private A():
Expand Down
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/3constructor/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

class A inherits B:
constructor private A():
Expand Down
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/4destructor/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

class A inherits B:
destructor public A():
Expand Down
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/4destructor/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

class A inherits B:
destructor public A():
Expand Down
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/5do/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

do:
end.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/5do/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

do:
end.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/6do_on/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

do on error undo, throw:

Expand Down
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/6do_on/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

do on error undo, throw:

Expand Down
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/7do_to/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

do iCount = iTotal to 5:
end.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/7do_to/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

do iCount = iTotal to 5:
end.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

do transaction:
end.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

do transaction:
end.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/9do_while/input.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

do while i < 5:
end.
2 changes: 1 addition & 1 deletion resources/functionalTests/emptyBlock/9do_while/target.p
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* formatterSettingsOverride */
/* { "AblFormatter.emptyBlockFormatting": true}*/
/* { "AblFormatter.blockFormatting": true}*/

do while i < 5:
end.
10 changes: 10 additions & 0 deletions resources/functionalTests/for/1each-false/input.p
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* formatterSettingsOverride */
/* { "AblFormatter.blockFormatting": false,
"AblFormatter.forFormatting": false
}*/

for
each
Customer:
Customer.var += 1.
end.
10 changes: 10 additions & 0 deletions resources/functionalTests/for/1each-false/target.p
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* formatterSettingsOverride */
/* { "AblFormatter.blockFormatting": false,
"AblFormatter.forFormatting": false
}*/

for
each
Customer:
Customer.var += 1.
end.
Loading

0 comments on commit 95f9e0f

Please sign in to comment.