#691 Improved FreeBasic support

v1.23
pending
FreeBasic (1)
5
2014-08-19
2013-11-15
TJF
No

Next scintilla version (> 3.3.6) will come with advanced syntax highlighting for FreeBasic language (details at https://sourceforge.net/p/scintilla/feature-requests/1023/). We need adaption to get this working in Geany.

The attached patch contains

  • new filedef-tag declarations (src/highlightingmappings.h)
  • initialisation of new tags (data/filetypes.freebasic)
  • keyword updates for fbc-0.90.1 (data/filetypes.freebasic)
  • some snippets (data/snippets.conf)
1 Attachments

Discussion

  • TJF

    TJF - 2013-11-15

    Just found out: there's a ',' missing in the patch diff.txt (previous post).

    Here's an update with all changes (including scitilla code)

     
  • Colomban Wendling

    • labels: --> FreeBasic
    • status: open --> pending
    • assigned_to: Colomban Wendling
     
  • Colomban Wendling

    The styling part was fixed in the update to 3.4.1 [0b4ec549fc02d781a6213fad109f954dcaf28f40]

    I didn't include keywords endif and interface as they aren't listed in http://www.freebasic.net/wiki/wikka.php?wakka=CatPgFunctIndex but if they aren't a mistake please say so. [bb25ba6ed2aca71ac63e2398bb5b5dc8fb4004a8]

    I also added #assert, #line and once to the preprocessor keywords in addition to #lang, and removed #dynamic and #static as they weren't in the above documentation, and I found a report as them being wrong (http://www.freebasic.net/forum/viewtopic.php?t=1095). [8278d7f9f0c3adc1c69eddd880eb28a600a862cd]

    I didn't merge the snippets yet because I'm not sure we want such short and not necessarily intuitive names by default. For other languages we mainly have snippets expanding to a full construct named after that construct start (e.g. if expanding to something like if () {}, etc.), so I'm not sure we want things like the pif or ope in this patch in the default configuration. Any opinion on that @elextr @codebrainz @ntrel?

     

    Related

    Commit: [0b4ec5]
    Commit: [8278d7]
    Commit: [bb25ba]

    • Lex Trotman

      Lex Trotman - 2014-08-19

      I understand the OPs desire for conciseness, but snippets that are going to go in the system file to be delivered with Geany to all users should be reasonably intuitive, ie open not ope.

      Can't suggest a #if one though :)

       
  • Colomban Wendling

    • summary: Advanced syntax highlighting (Scintilla > 3.3.6) --> Improved FreeBasic support
     
  • TJF

    TJF - 2014-08-19

    Hello Colomban, good job!

    Thanks for spending so much time to check the keywords. All seems to be OK, exept 'endif': both END IF and ENDIF are allowed in FreeBASIC (although ENDIF isn't in the list you mentioned). The German reference includes it at

    http://www.freebasic-portal.de/befehlsreferenz/endif-247.html

    My snippets are also named after the construct start, but only the first three characters are used. Ie. 'ope' expands to an OPEN construct. Exeption: 'pif' expands to a Pre-processor #IF construct. Feel free to merge them or not.

    I don't understand your question:
    'Any opinion on that @elextr @codebrainz @ntrel?'

     
    • Colomban Wendling

      All seems to be OK, exept 'endif': both END IF and ENDIF are allowed in FreeBASIC [...]

      Ok, added it back in [0817dddc855a062521e64172810b3ede913eb004]

      My snippets are also named after the construct start, but only the first three characters are used.

      I get that, but my concern was whether we do want them abbreviated in the default configuration, as this is inconsistent with what we have for other languages. I do get the use case for shorter names of course, but it may not be as intuitive as having the whole name -- or at least less consistent with what we already have.

      'ope' expands to an OPEN construct

      I see, but my point was it doesn't expand to something that starts with ope, so one would have to know one wants to use the snippet beforehand, which raises the same question as above.

      Exeption: 'pif' expands to a Pre-processor #IF construct

      Hum, yes, unfortunately we don't support # in snippet key AFAIK (and certainly not at the start), so you indeed cannot use the real construct start.

      I don't understand your question:
      'Any opinion on that @elextr @codebrainz @ntrel?'

      I was just trying to get the opinion of other main contributors, those are their nickname -- and prefix with @ comes from other habits, even though it doesn't work here --, nothing you have to worry about :)

       

      Related

      Commit: [0817dd]


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks