mirror of
https://github.com/pichsenmeister/WienerScript.git
synced 2025-03-14 17:49:03 +01:00
edit readme
This commit is contained in:
parent
a58243464d
commit
50aae42f22
1 changed files with 5 additions and 31 deletions
36
README.md
36
README.md
|
@ -1,6 +1,6 @@
|
||||||
WienerScript
|
# WienerScript
|
||||||
==============
|
|
||||||
|
|
||||||
|
```
|
||||||
HACKL AMOI WOS calc(operator, left, right) {
|
HACKL AMOI WOS calc(operator, left, right) {
|
||||||
WOS IS MIT DIR (operator) {
|
WOS IS MIT DIR (operator) {
|
||||||
I SCHAU NUR '+':
|
I SCHAU NUR '+':
|
||||||
|
@ -21,13 +21,13 @@ SCHAU MA MOL {
|
||||||
} LECK OASCH (err) {
|
} LECK OASCH (err) {
|
||||||
GSCHISSN GRISSN ('invalid operation')
|
GSCHISSN GRISSN ('invalid operation')
|
||||||
}
|
}
|
||||||
|
```
|
||||||
|
|
||||||
WienerScript adds syntactic sugar to JavaScript that makes it less forgiving, more emotional, and even painful to write, allowing you to do less with more code.
|
WienerScript adds syntactic sugar to JavaScript that makes it less forgiving, more emotional, and even painful to write, allowing you to do less with more code.
|
||||||
|
|
||||||
Common Viennese phrases and words act as intuitive replacements for common JavaScript keywords, operators, and more. You can continue to use raw JavaScript inside WienerScript, and the `wienerscript` transpiler will convert WienerScript code into raw JavaScript.
|
Common Viennese phrases and words act as intuitive replacements for common JavaScript keywords, operators, and more. You can continue to use raw JavaScript inside WienerScript, and the `wienerscript` transpiler will convert WienerScript code into raw JavaScript.
|
||||||
|
|
||||||
Installation
|
### Installation
|
||||||
----------------
|
|
||||||
|
|
||||||
WienerScript requires [Node.js and npm](https://nodejs.org/en/).
|
WienerScript requires [Node.js and npm](https://nodejs.org/en/).
|
||||||
|
|
||||||
|
@ -44,34 +44,8 @@ wienerscript
|
||||||
All files in that directory (and any subdirectories) that have a valid WienerScript file extensions (`.ws`) will be replaced by the transpiled contents of in the `/dist` directory.
|
All files in that directory (and any subdirectories) that have a valid WienerScript file extensions (`.ws`) will be replaced by the transpiled contents of in the `/dist` directory.
|
||||||
Input files conventionally use the `.ws` extension and output files conventionally use the `.js` extension.s
|
Input files conventionally use the `.ws` extension and output files conventionally use the `.js` extension.s
|
||||||
|
|
||||||
Example Program
|
|
||||||
----------------
|
|
||||||
|
|
||||||
An implementation of [FizzBuzz](http://c2.com/cgi/wiki?FizzBuzzTest) using a mix of ArnoldJS syntax and raw JavaScript:
|
### Usage
|
||||||
|
|
||||||
LET'S KICK SOME ICE
|
|
||||||
GIVE THESE PEOPLE AIR
|
|
||||||
YOU SET US UP n STICK AROUND 1;
|
|
||||||
n <= 100;
|
|
||||||
n STICK AROUND n GET UP 1
|
|
||||||
ENOUGH TALK
|
|
||||||
IT'S SHOWTIME
|
|
||||||
YOU SET US UP out STICK AROUND ;
|
|
||||||
BECAUSE I'M GOING TO SAY PLEASE
|
|
||||||
(I LIED (n I LET HIM GO 3))
|
|
||||||
out STICK AROUND out GET UP Fizz;
|
|
||||||
BECAUSE I'M GOING TO SAY PLEASE
|
|
||||||
(I LIED (n I LET HIM GO 5))
|
|
||||||
out STICK AROUND out GET UP Buzz;
|
|
||||||
TALK TO THE HAND (out
|
|
||||||
WHAT'S WRONG WITH YOUR EYES out
|
|
||||||
I NOW KNOW WHY YOU CRY n);
|
|
||||||
HASTA LA VISTA BABY
|
|
||||||
|
|
||||||
This program can be found in `samples/fizzbuzz.ajs`. Its transpiled version can be found in `samples/fizzbuzz.js`.
|
|
||||||
Additional examples can be found in the `samples` directory.
|
|
||||||
|
|
||||||
Usage
|
|
||||||
|
|
||||||
| WienerScript | JavaScript |
|
| WienerScript | JavaScript |
|
||||||
| ----- | ----- |
|
| ----- | ----- |
|
||||||
|
|
Loading…
Reference in a new issue