Repository navigation
Humal 1.3.0
Added
- Added
switchstatement support. - Added indentation-based
caseclauses. - Added
defaultclause support. - Added support for multiple
caselabels and JavaScript fall-through behavior. - Added support for
breakinsideswitch. - Added support for JavaScript expressions in
caseconditions. - Added support for nested
switchstatements. - Added support for existing Humal constructs inside
casebodies.
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
- Improved indentation handling for
switchstatements. - Enhanced compiler support for JavaScript control flow constructs.
- Continued focus on keeping Humal syntax close to JavaScript while using indentation instead of block punctuation.
- 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.
