Skip to content

Commit

Permalink
[FORMAT] More cases
Browse files Browse the repository at this point in the history
  • Loading branch information
PeyTy committed Jun 22, 2024
1 parent 1bf5a68 commit 9e40679
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion source/server/format.hexa
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

/// Formatting preserves user personal style
fun autoFormatWholeFile(file: String): String {
let project = new Project()
let content = Buffer.from(file)
Expand Down Expand Up @@ -95,7 +96,6 @@ fun autoFormatWholeFile(file: String): String {

if
// TODO #if
// TODO @dec
// TODO (\nargs\n)
// TODO if\nconds\n{}
lastToken == Token.Eof or
Expand All @@ -109,6 +109,7 @@ fun autoFormatWholeFile(file: String): String {
token == Token.CallOpen and
(
lastToken != Token.KIf and
lastToken != Token.KNew and
lastToken != Token.Assign
)
) or
Expand All @@ -124,6 +125,9 @@ fun autoFormatWholeFile(file: String): String {
) or
token == Token.IndexClose or

// `@at`
(token == Token.Identifier and lastToken == Token.At) or

token == Token.KNot or
token == Token.Comma or
token == Token.Colon
Expand Down

0 comments on commit 9e40679

Please sign in to comment.