B4J Question Where can I get a list of all B4X constructs for a Code Formatter?

Mashiane

Expert
Licensed User
Longtime User
Let me clarify, currently these are my "start block" constructs for indentation determination.

B4X:
"For", "Do", "While", "Select", "Case", "Else",  "#Else", "Sub", "Try", "#Region", "Private", "Public", "#If",

My "end blocks" are

B4X:
"Next", "Loop", "End Select", "End Sub", "Case", "Else", "#Else", "Else If", "#Else If", "End If", "#End If", "Catch", "End Try", "#End Region"

Now with the list I want to check if I have everything covered to ensure that the code formatter I'm doing works well.

Thanks.
 
Upvote 0

Heuristx

Active Member
Licensed User
Longtime User
What will you do with lines that continue, broken up with the " _" character? Should the code be indented after first such line break? To make that more difficult, how about the smart strings that can be written in multiple lines?
 
Upvote 0

Mashiane

Expert
Licensed User
Longtime User
What will you do with lines that continue, broken up with the " _" character? Should the code be indented after first such line break? To make that more difficult, how about the smart strings that can be written in multiple lines?
Good question. Line continuation character removal can be turned on or off.

Currently my implementation trims all lines on first run and then remove blank spaces, then depending on the construct, indents or not. So where for example there is a smart string, nothing is done on it except indent it based on the last rule applied to the previous line.
 
Upvote 0
Top