BenBE's humble thoughts Thoughts the world doesn't need yet …

13.11.2013

GeSHi on Git

Filed under: GeSHi — Schlagwörter: , , , , — BenBE @ 09:55:09

It’s FINALLY done!

GeSHi is now officially available on GitHub! (more…)

Flattr this!

06.03.2013

Zero is too large!

Filed under: GeSHi — Schlagwörter: , , , , , — BenBE @ 22:36:02

Welcome to our new series of strange bugs. Today we’ve got a brand new candidate called emptyness which is a really great star on the floor of PHP bugs. I was being stumbled upon this one by Thomas Puls who mailed me about the fact, that if you highlight a single 0 with GeSHi, it magically disappears. (more…)

Flattr this!

04.11.2012

Doing updates

Filed under: GeSHi — Schlagwörter: , , , , , , — BenBE @ 13:07:46

What does it take to get Debian to update a package?

More than two years, about 50 mails, 10 people from 3 different Debian-related IRC channels, 4 bugs filed by upstream and 2 security-related issues reported to the Security team … Sound’s legit IMHO. (more…)

Flattr this!

27.08.2012

News in and around GeSHi 1.0.8.11

Filed under: GeSHi — Schlagwörter: , , , , , , , — BenBE @ 00:00:14

Being way overdue, and not only because some other projects askednagged for a release, I’m really pleased I finally had everything together last week so I could do the release of GeSHi 1.0.8.11. Besides the 18 new language files there are also two important bugfixes addressing problems in contrib scripts. (more…)

Flattr this!

06.08.2012

Last steps towards GeSHi 1.0.8.11

Filed under: GeSHi — Schlagwörter: , , , , , , , , — BenBE @ 01:06:12

Hi guys,

I know it’s been quite a bit since the last release of GeSHi and even though there’s been some confusion about what the most recent version actually was, I’ll probably lighten up the confusion a bit and present some good news to all of you who are waiting for some of the most recently included language files. But first things first. (more…)

Flattr this!

15.04.2012

DCPU-16 highlighting

Filed under: GeSHi — Schlagwörter: , , , — BenBE @ 00:55:54

Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /var/www/virtual/benny-baumann.de/blog/htdocs/wp-content/plugins/wp-syntax/wp-syntax.php on line 380

Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /var/www/virtual/benny-baumann.de/blog/htdocs/wp-content/plugins/wp-syntax/wp-syntax.php on line 380

Not quite 0x0001 0000 0000 0000 years since the last post in this category but still long enough to justify emitting a new sign that there’s still some developement going on with GeSHi. And it’s quite a coincidence that Markus „Notch“ Persson is taking over GitHub with its own new language now being highlighted. And since most assembly languages are quite easy to highlight it’s only natural to add support for highlighting of this new language for GeSHi.

So there it is: After only about 10 minutes looking at the language specs the basic structure looked simple enough and since GeSHi already supported a bunch of different assembly languages it’s only natural to use another one of them as the template. In this case I decided go for Z80 assembly as the ZiLOG Z80 instruction set is quite simple and still the language file was elaborate enough to support all the features required by Notch’s new assembly language. Actually: I even could remove some features not required to properly highlight DCPU-16.

After a short clean-up of the language file – removing all the old instructions, registers and directives – it took only few more steps to fill in the list of supported instructions: In the case of the DCPU-16 instruction set this is a quite small set of only 16 instructions, 11 registers and 3 „memory shortcuts“. Thus there was not that much to copy from the specs, althoug the example given there looks quite nice when rendered with this new language file:

; Try some basic stuff
              SET A, 0x30              ; 7c01 0030
              SET [0x1000], 0x20       ; 7de1 1000 0020
              SUB A, [0x1000]          ; 7803 1000
              IFN A, 0x10              ; c00d 
                 SET PC, crash         ; 7dc1 001a [*]
 
; Do a loopy thing
              SET I, 10                ; a861
              SET A, 0x2000            ; 7c01 2000
:loop         SET [0x2000+I], [A]      ; 2161 2000
              SUB I, 1                 ; 8463
              IFN I, 0                 ; 806d
                 SET PC, loop          ; 7dc1 000d [*]
 
; Call a subroutine
              SET X, 0x4               ; 9031
              JSR testsub              ; 7c10 0018 [*]
              SET PC, crash            ; 7dc1 001a [*]

There were no major problems, except for some trouble with two regular expressions which broke rendering; but since those weren’t needed I could just simply remove them.

If you like to try out the language file for yourself just visit the main GeSHi site or grab a copy of the language file directly from the SVN trunk.

Flattr this!

02.08.2011

FizzBuzz BrainFuck

Filed under: Fun,GeSHi — Schlagwörter: , , — BenBE @ 01:17:35

Well yeah, after some nasty person dropped a link about why programmers are so bad at programming I somehow got to have a look at the Rosetta Code project’s site detailling this task and found (not to my surprise) that noone had solved that task — yet! So I sat down and implemented it. Usually this task should take you only about a few minutes but since I hardly ever programm anything in BrainFuck it took me roughly 45 minutes to complete. But well: Here’s the result (Beware: Ugly code)! (more…)

Flattr this!

11.02.2011

GeSHi getting signed

Filed under: GeSHi — Schlagwörter: , , — BenBE @ 23:10:08

Because of a recent attack against SourceForge all the GeSHi releases will be available signed to allow for verification of authenticity of the released files. (more…)

Flattr this!

18.01.2011

Final crafting on GeSHi 1.0.8.10

Filed under: GeSHi — Schlagwörter: , , , , , — BenBE @ 03:24:46

Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /var/www/virtual/benny-baumann.de/blog/htdocs/wp-content/plugins/wp-syntax/wp-syntax.php on line 380

Warning: WP_Syntax::substituteToken(): Argument #1 ($match) must be passed by reference, value given in /var/www/virtual/benny-baumann.de/blog/htdocs/wp-content/plugins/wp-syntax/wp-syntax.php on line 380

After a somewhat longer period of silence from my side, due to some vacation I took, I’m proud to announce that there have quite some changes for the next release of GeSHi accumulated in the SVN trunk which will be the basis for the next release of GeSHi. As most of you might already have guessed the next release will be version 1.0.8.10, which is the first version of GeSHi in 2011 and also the first version since half a year. So what’s new with this version?

Well, the question is a bit complicated to answer, so let me split this into three parts. The first of which is all the changes to the parser of GeSHi itself. One of the changes here is a change of the handling of dashes when creating regular expressions which are used internally for GeSHi to speed up the highlighting of keywords. The problem here was that in some occasions dashes were left unescaped as part of the regexp and thus got a special meaning within character groups causing unpredictable behaviour. Although this couldn’t be used for malicious activity it was an annoying side effect causing GeSHi to crash when encountering language files which used dashes in their keywords. COBOL is one of them, Scheme another.

But let’s stay with the internal changes for another moment: There was another bug this time which affected e.g. PHP, but actually quite a bunch of other languages too. The reason for this bug is a bit more complicated to explain though, as it involves some of the internas and the precautions of GeSHi to avoid XSS attacks by the code that should be highlighted. When you look at the code sample provided there you will notice the semicolon before the offending if, right? Now, as we all know, GeSHi tries to output HTML code. This fact is important here because the semicolon – even though it doesn’t need escaping is crucial for valid HTML as it terminates escape sequences and therefore needs special treatment as we can’t simply go ahead and markup every ; we find: It might be part of an escape sequence. Luckily GeSHi works around the problem here and escapes two characters not which their HTML entity, but with something else: | with <PIPE> and – you guessed ; with <SEMI>, avoiding this disambiguity this way. Now for the problem: The default boundary checks for keywords didn’t take these replacements into account and thus hadn’t had < and > in them and therefore did NEVER match any keyword accompanied by one of those two characters. Literal < and > BTW are escaped beforehand and thus appear as &lt; and &gt; in the source when checking boundaries. Coming with this release also < and > are part of the default lists of characters allowed as boundary of a word and thus enabling the proper highlighting of the sample code in the bug report linked above.

The third issue regarding the parser is not a change of the parser itself, but rather a convenience check added to the language file checking script which didn’t verify filenames properly and thus sometimes returned invalid filenames to be checked. This bug didn’t allow for code execution, but rather produced annoying error messages when some temporary files clobbered up your language file directory.

After we’re now done with the changes to the parser let’s discuss the changes to existing language file since we have quite a few already and I’m sure I did miss even some more in the depths of my inbox! So here we go: Users of Algol68 might like the greatly improved language file by Neville Dempsey which didn’t make it into the previous release since there were some issues I needed feedback on. But even having the language file in a bit later should be early enough for you to enjoy.

Another language file which only got updated in this release is J, which is maintained by Ric Sherlock and uses one of the features fresh introduced in the previous release and now highlights all the numbers of the language J correctly, which are quite an oddity and thus needed a small adjustment of the parser to work. Or better: A tweak to make the parser look for some numebers which don’t contain digits – which actually exist in J with negative Infinity being one such example.

All friends of GDB might be in this release too, because Milian Wolff contributed an reworked and improved version for highlighting GDB stacktrace outputs making them by far more readable – believe me! So if you get the next blob of GDB output you can’t work your way through: Maybe ask GeSHi for a bit more insight. No pun intended!

Actually a bug spawning accross two language files was related to the handling of multiline comments in Javascript (and therefore also ActionScript) which both try to highlight regular expressions if they happen to detect them. The initial report for this issue was by Kevin Day who pointed me to the problem with ActionScript which could, by backporting the fix to JavaScript also be solved there. Unfortutnally I forgot one condition for JS: Multiline comments and regular expressions look SOOO close to each other, /*don’t they/ 😉 Another bug of this kind was related to F# and its prefix operators, which – you guessed it – can under certain conditions look like comments:

(*) 6 9 (* Just for reference: This comment answers questions ;-) *)

Another update to language files the new release got is related to the language GO which got some of the LangCheck warnings fixed which slipped in. Usually those don’t mean too much harm, but in regards to maintainability and consistency to what I expect from language file contributors the release should go on ahead and follow the rules, which it thanks to this patch now does.

Furtheremore in the section of updates to language files we have updates of the keyword lists for Objek (Randy Hollines), Liberty BASIC (Chris Iverson), TeraTerm (Boris Maisuradze) and Apache Configuration files (now supporting another module’s configuration options). And last but not least there are some additional comment styles for SAS (ahnolds) and fixed handling of escape sequences for CSS (yecril71pl).

And since there’s always news to report on brand new language files: here they are!

  • BASCOM AVR (Michal Goralczyk)
  • C: Loadrunner dialect (Stuart Moncrieff)
  • CoffeeScript (Trevor Burnham)
  • EPC (Thorsten Muehlfelder)
  • Falcon (billykater)
  • LLVM (Azriel Fasten)
  • UnrealScript (pospi)
  • YAML (Josh Ventura)

The two more famous of those new language probably are LLVM, an hardware-independent assembler language used as a textual representation of the intermediate code generated by the compiler framework of the same name, and YAML, which (given it’s name) ain’t markup, but serialization of data structures.

Also we have BASCOM AVR, which is used for microcontroller programming, and UnrealScript, the Scripting language used in the Unreal Engine (usually producing unreal results if you don’t know what you have to expect from your code).

So much from my side for now. Until the actual release arrives some more changes might get into, but those are definite. So look forward for the next release which will be out as soon as I manage to wrap things up.

Flattr this!

23.09.2010

GeSHi 1.0.8.9 finally packaged

Filed under: GeSHi — Schlagwörter: , , , , — BenBE @ 15:59:12

I know it’s about two months now, but I finally got around to do the last steps that were missing for GeSHi 1.0.8.9: Packaging it 😉 (more…)

Flattr this!

Older Posts »

Powered by WordPress