GithubHelp home page GithubHelp logo

sodaware / blitzmax-mode Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 2.0 76 KB

An Emacs major mode for editing BlitzMax source files

Home Page: https://www.sodaware.net/dev/tools/blitzmax-mode/

License: GNU General Public License v2.0

Emacs Lisp 100.00%
emacs blitzmax

blitzmax-mode's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

blitzmax-mode's Issues

Repeat...Forever loop is not indented correctly

Repeat ... Until is indented correctly. However, Repeat...Forever does not indent correctly.

Example (wrong) indentation:

Repeat
    ' Content here
    Forever

Should look like this:

Repeat
    ' Content here
Forever

TODO

  • Add test case for Repeat...Forever indentation
  • Update blitzmax-mode-until-regexp with Forever syntax

Indentation fails with mixed + nested `If` statements

Single-line if/then statements normally indent correctly, but they fail when nested inside another block:

If something Then
    ' Indented correctly
    If False Then Continue
    ' Also indented correctly
    Else
    End If

Both the Else and End If should be indented level with the first If, not the second (inline) one.

Does not ignore escape sequences in strings, but should

BlitzMax doesn't use escape sequences in strings. For example, a quote character is inserted as ~q rather than \".

Backslash characters should be treated like any other character in a string. Currently they're treated as an escape character:

Print "I end in a backslash\"
' This will be font-locked as a string, rather than a comment

Abstract Methods and Functions break indentation

Abstract functions should not increase indentation.

' Incorrect indentation
Type MyType
    Function doThis() Abstract
        Function doThat() Abstract
End Type

' Correct indentation
Type MyType
    Function doThis() Abstract
    Function doThat() Abstract
End Type

Semi-colon character is not counted as newline when indenting

BlitzMax supports using a ; character as a newline. Automatic indentation does not take this into account, so single-line definitions mangle the indent level:

Function iAmEmpty() ; End Function
    Print "I should not be indented"

The second line should not be indented. This problem happens with all indented syntax: While, Repeat, For, Function, If, Select, Type and Method.

Compile main file of project, no matter the buffer

https://github.com/textmate/blitzmax.tmbundle

The TextMate bundle uses environment settings to compile projects, not just buffers. Thanks to .tm_properties files, these can be set per directory/project, which is nice. I think with the power of .dir-locals.el to auto-load when opening a buffer, one can do the same for Emacs.

My elisp isn't that good, that's why I didn't work on a PR right away and want to coordinate efforts first. What do you think?

"Extern" / "End Extern" does not indent correctly

The Extern and End Extern keywords do not currently indent their contents correctly. They also cause Function indentation to fail.

Example (wrong) indentation:

Extern
Function ExternalFunction()
    Function AnotherExternalFunction()
        End Extern

Should look like this:

Extern
    Function ExternalFunction()
    Function AnotherExternalFunction()
End Extern

TODO

  • Add indentation for "Extern" / "End Extern" region
  • Do not increase indent for external functions

Fix weird indentation error with if/endif

The following code does not indent correctly:

If Self.entityHasItems(event.getEntity()) Then
	' Should be indented
EndIf

Changing getEntity to just tEnt still causes the issue, so it's probably a regex issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.