Skip to content

Commit

Permalink
Fixed documentation to fit code. Added the beginning of a usage docum…
Browse files Browse the repository at this point in the history
…ent.
  • Loading branch information
runekaagaard committed Dec 12, 2012
1 parent 236ac17 commit 9a1c206
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 33 deletions.
60 changes: 27 additions & 33 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,30 @@ Roadmap

The current status as of October 3rd, 2012 is that both the lexer and parser
actually works. A lot of Snowscript can be compiled to PHP. But there is still
tons of work until it's usable. Come join the fun!
tons of work until it's usable. Version 0.4 will be the first release and will
be of alpha quality. Come join the fun!

Todo 0.4
========

- Webpage.
- Documentation.
- Scoping rules.
- Classes part2.
- Command line compile tool.
- Command line compile tools.
- Full examples.
- Some bugs in comments.
- Tolerable error messages.
- Code cleanup.

Done
====

- Comments.
- Strings.
- Ternary operator.
- Control structures.
- For loops.
- Function style casts.
- Classes part1.
- Classes part1 + 2.
- Destructuring.
- Parsing of basic syntax.
- Transformations for the non LALR(1) compatible features of Snowscript like
Expand Down Expand Up @@ -101,47 +101,41 @@ Comments
snowscript::

# Single line.
# Single line as docblock. #
# This is a docblock,

spanning multiple lines.
###
Multiple
Lines.
###

php::

// Single line.
/**
* Single line as docblock.
*/
/**
* This is a docblock,
*
* spanning multiple lines.
*/
/*
Multiple
Lines.
*/

Arrays
======

Arrays are defined using square brackets "[]". Items are separated by ",". A
trailing "," is allowed.

Arrays can contain key/value pairs seperated with "=". The keys can be omitted
and running integers will be assigned. Keys are always interpreted stringy.
Keys not matching the regex "[a-zA-Z_][a-zA-Z0-9_]+" can be made by surrounding
the key with quotes.
Arrays can contain key/value pairs seperated with ":". The keys can be omitted
and running integers will be assigned.

snowscript::

pianists = ["McCoy Tyner", "Fred Hersch", "Bill Evans"]
series = [
Heroes = [
genre = "Science Fiction",
creator = "Tim Kring",
seasons = 4,
"Heroes": [
"genre": "Science Fiction",
"creator": Tim Kring",
"seasons": = 4,
],
"Game Of Thrones" = [
genre = "Medieval fantasy",
creator = "David Benioff",
seasons = 2,
"Game Of Thrones": [
"genre": "Medieval fantasy",
"creator": "David Benioff",
"seasons": 2,
],
]

Expand Down Expand Up @@ -192,8 +186,8 @@ Strings

There are four kind of strings: """, ", ''' and ', all multiline.

Whitespace before the current indentation level is stripped. All empty lines
ending in "\\" is stripped.
Whitespace before the current indentation level is stripped. A newline can be
cancelled by ending the previous line with "\\".

Quoted
------
Expand All @@ -205,8 +199,8 @@ snowscript::
fn travel
echo "\
The {animal} went to {world.place()}
with his {NUM} friends.
\"
with his {NUM} friends.\
"

"""<a href="https://snowscript.org">Snowscript</a>\n"""

Expand Down
15 changes: 15 additions & 0 deletions USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Using Snowscript
++++++++++++++++

Stub.

The following tools exists in the "bin" folder::

snow-compile /abs/path/to/file.snow
- Outputs the compiled php code to stdout

snow-watch-mac /abs/path/to/dir1 /abs/path/to/dir2 ...
- Watches for changes to ".snow" files in given directories and
- recompiles ".php" files with the same name and path.

0 comments on commit 9a1c206

Please sign in to comment.