Skip to content

Humal 1.3.0

Choose a tag to compare

@qvelop qvelop released this 09 Oct 14:38
· 25 commits to master since this release

Added

  1. Added switch statement support.
  2. Added indentation-based case clauses.
  3. Added default clause support.
  4. Added support for multiple case labels and JavaScript fall-through behavior.
  5. Added support for break inside switch.
  6. Added support for JavaScript expressions in case conditions.
  7. Added support for nested switch statements.
  8. Added support for existing Humal constructs inside case bodies.

Examples

Basic switch

let value = 2

switch value
    case 1
        print "one"
        break

    case 2
        print "two"
        break

    default
        print "other"

Multiple case labels

let value = 2

switch value
    case 1
    case 2
    case 3
        print "one, two or three"
        break

    default
        print "other"

Expressions in case

let value = 10

switch value
    case 5 + 5
        print "expression works"
        break

    default
        print "no match"

Improvements

  1. Improved indentation handling for switch statements.
  2. Enhanced compiler support for JavaScript control flow constructs.
  3. Continued focus on keeping Humal syntax close to JavaScript while using indentation instead of block punctuation.
  4. Improved the VS Code extension: the global Humal Dark theme was removed, and syntax handling was enhanced.

Install the VS Code extension

Download the .vsix file, then in VS Code go to the Extensions view, click the three dots, select Install from VSIX..., and choose the downloaded .vsix file.

humalscreenshot1 humalscreenshot