Skip to content

andrewwhipple/snavascript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

#SnavaScript

SnavaScript (snail javascript) is a language that snompiles (snail compiles) to JavaScript, and has snexactly (snail exactly) the sname (snail same) sneatures (snail features) that JavaScript does.

SnavaScript currently requires the following syntax (mapped to it's vanilla JavaScript equivalent, ):

// snavaScript -> javaScript 

snif -> if
snelse -> else
Sninfinity -> Infinity
SNaN -> NaN
snull -> null
sneval -> eval
snuneval -> uneval
snis -> is
snarse -> parse
snecode -> decode
snencode -> encode
snunecode -> unencode
snescape -> escape
Snobject -> Object
Snunction -> Function
Snoolean -> Boolean
Snymbol -> Symbol
Snerror -> Error
Sneval -> Eval
Sninternal -> Internal
Snrange -> Range
Snyntax -> Syntax
Snrange -> Range
Snype -> Type
SNURI -> URI
Snumber -> Number
Snmath -> Math
Snate -> Date
Snring -> String
SnregSnexp -> RegExp
Snarray -> Array
Snint -> Int
Snmap -> Map
Snet -> Set
SNASON -> JSON
Sniterator -> Iterator
snarg -> arg
snontinue -> continue
snwitch -> switch
snar -> var
snunction -> function
snreturn -> return
snfor -> for
sneach -> each
snimport -> import
snwith -> with
snthis -> this
snew -> new
snuper -> super
snelete -> delete
snvoid -> void
sninstancesnof -> instanceof

To compile, use this python-based snavaScript snompiler (snail compiler) on a valid .sns file (the filetype for snavaScript files):

python snavaSnompiler.py snfoo.sns

As written, this will compile to a file called snfoo.js in the same directory.

You can optionally include a filename for the compiled javascript (with the .js included!)

python snavaSnompiler.py snfoo.sns foo.js

[Also this has basically zero error checking or anything fancy. Use at your own snperil (snail peril)]

Snappy snoding!

(snail happy coding)

@AndrewTheWhip

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages