Skip to content

Commit

Permalink
Merge pull request #43 from stormprograms/dev
Browse files Browse the repository at this point in the history
StormScript v0.5.0
  • Loading branch information
abbyonstott authored Feb 13, 2019
2 parents caff4ef + 5a272f6 commit d5415d5
Show file tree
Hide file tree
Showing 37 changed files with 148 additions and 522 deletions.
7 changes: 3 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ add_executable(stormscript
src/core/stormscript.cc
src/core/set.cc
src/core/errors.cc
src/core/runlibfunc.cc
src/parser/parse.cc
src/parser/read.cc
src/parser/modules.cc
src/interpreter/globscope.cc
src/interpreter/exec.cc
src/stream/io.cc
src/stream/stsstream.cc
src/stream/loops.cc
src/values/stsdec.cc
src/values/man.cc
src/values/if.cc
Expand All @@ -23,5 +22,5 @@ add_executable(stormscript
src/classes/dectype.cc
src/classes/decmethod.cc)
set (StormScript_VERSION_MAJOR 0)
set (StormScript_VERSION_MINOR 4)
install(TARGETS stormscript RUNTIME DESTINATION bin/)
set (StormScript_VERSION_MINOR 5)
install(TARGETS stormscript RUNTIME DESTINATION bin/)
41 changes: 2 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,6 @@

[![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/stormscript)

## How to Build
StormScript is a programming language made in C++

Terminal:

To build StormScript clone this repository and cd into it. Run
```
$ cmake CMakeLists.txt
```
and
```
$ make
```
You can then add it to path or install it to /usr/bin.

Visual Studio Code:

Clone this repository like before and open it in Visual Studio Code. Make sure you have the CMake, C++, and python plugins installed. Press `Build:` in the bottom left or press `f5` to start debugging.

When it builds, it should be put into a `build/` directory.

## Layout

Folder | Description
------ | -----------
docs/ | contributing guide, code of conduct. etc.
src/core/ | The core StormScript files
src/stream/ | Files that deal with the console.
build-scripts/ | Scripts to be packaged with releases
src/classes/ | Files that deal with classes.
src/values/ | Files that deal with variables and functions.
tests/ | Files for testing that core functionality is not messed up.

## Files You Should Know

file | Description
---- | -----------
[src/core/stormscript.cc](src/core/stormscript.cc) | This is where files are read.
[src/core/errors.cc](src/core/errors.cc) | This is where all new errors are added.
[src/parser/parse.cc](src/parser/parse.cc) | This is the parser.
[src/interpreter/exec.cc](src/interpreter/exec.cc) | This is the function that interprets functions
Read [building.md](docs/building.md) for info on how to build
10 changes: 0 additions & 10 deletions api/python/README.md

This file was deleted.

13 changes: 0 additions & 13 deletions api/python/build.sh

This file was deleted.

9 changes: 0 additions & 9 deletions api/python/getname.py

This file was deleted.

63 changes: 0 additions & 63 deletions api/python/reader.cc

This file was deleted.

8 changes: 0 additions & 8 deletions api/python/stormscript/__init__.py

This file was deleted.

Binary file removed api/python/stormscript/__init__.pyc
Binary file not shown.
3 changes: 3 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,8 @@ steps:
- script: |
cmake CMakeLists.txt;
make;
mkdir build;
mv stormscript build;
cd scripts;
./runtests.sh
displayName: 'make'
12 changes: 1 addition & 11 deletions build-scripts/install.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
#!/bin/bash
cmake CMakeLists.txt
cmake CMakeLists.txt -DCMAKE_CXX_COMPILER:STRING="g++"
make
sudo cp stormscript /usr/bin
g++ src/libraries/system/reader.cc -o src/libraries/system/system.stslib
g++ src/libraries/random/reader.cc -o src/libraries/random/random.stslib

if [ ! -e ~/.stormscript ]; then
mkdir ~/.stormscript
echo 'export PATH=$PATH:'$HOME'/.stormscript' >> ~/.bashrc
fi

cp src/libraries/*/*.stslib ~/.stormscript
cp src/libraries/*/*.py ~/.stormscript
cp -r api/python/stormscript ~/.stormscript
stormscript finished.sts
exec bash
1 change: 0 additions & 1 deletion build-scripts/uninstall.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/bin/bash
sudo rm /usr/bin/stormscript
sudo rm -rf $HOME/.stormscript
echo StormScript Removed
33 changes: 33 additions & 0 deletions docs/building.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Building StormScript

Make a directory called build

You must have gcc installed (MinGW for Windows) and CMake

## Linux

Terminal:

To build StormScript clone this repository and cd into it. Run
```
$ cmake CMakeLists.txt
```
and
```
$ make
```
You can then add it to path or install it to /usr/bin.

## Windows

Make sure you have MinGW-make installed

Run CMake GUI, and configure for MinGW-make

output should be a MakeFile, run mingw-make in that directory.

## Visual Studio Code

Clone this repository like before and open it in Visual Studio Code. Make sure you have the CMake, C++, and python plugins installed. Press `Build:` in the bottom left or press `f5` to start debugging.

When it builds, it should be put into a `build/` directory.
12 changes: 12 additions & 0 deletions docs/changelogs/changelog-v0.5.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# StormScript v0.5.0 "Eggplant"

## What's New
* `while` can be used to make while loops
* New Escape Characters, `\t` and `\\`
* Windows version
* Modules have been removed due to compatibility issues
* Libraries have been removed due to compatibility issues
* New scripts folder for build scripts

## What's Fixed
* `runtests.sh` will now exit with code 1 on failure
12 changes: 2 additions & 10 deletions docs/readme.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
# About

## Table of Contents
* [Why is this special?](#why-is-this-special)
* [How to Build](#how-to-build)
* [Layout](#layout)
* [Files You Should Know](#files-you-should-know)

## Why is this special?

StormScript is important not because it presents 1 or 2 revolutionary ideas that change your usual workflow, but because it changes almost everything about common programming syntax to make it easier to read and write. **This may seem more like a problem at first,** but I believe that StormScript changes programming syntax *for the better.* Here are a few examples:

1. Keywords
Expand All @@ -33,7 +25,7 @@ do{
f => x: "hi";
}
```
Another example of this is the `|` symbol, which is usually used as a separator. In StormScript, the `|` symbol tells the intepreter to find a property. For example:
Another example of this is the `|` symbol, which is usually used as a separator. In StormScript, the `|` symbol tells the interpreter to find a property. For example:

```
type person{
Expand All @@ -54,4 +46,4 @@ do{
}
```
In StormScript, the `is` keyword replaces the `==` symbol and `not` replaces the `!=` symbol.
In StormScript, the `is` keyword replaces the `==` symbol and `not` replaces the `!=` symbol.
14 changes: 5 additions & 9 deletions example/example.sts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
do{
x: 4;
printl "Hello, World!";

if x is 3 {
printl "hi";
}else if x is 4 {
printl "hi there";
}else {
printl "bye";
x: 3;
y: 10;
while x not y {
x+: 1;
printl x;
}
}
4 changes: 2 additions & 2 deletions packagerelease.sh → scripts/packagerelease.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#!/bin/bash
cd ..
rm -r release/*
echo "What is the version number (Formatted M.m.p):"
read vnum

echo "Packaging stormscript v$vnum for release."

cmake CMakeLists.txt
cmake CMakeLists.txt -DCMAKE_CXX_COMPILER:STRING="g++"
make
install stormscript build/stormscript
rm stormscript
Expand Down Expand Up @@ -42,7 +43,6 @@ cd stormscript_v$vnum

cp ../../CMakeLists.txt .
cp -r ../../src .
cp -r ../../api .
cp ../../build-scripts/* .

echo "Compressing folder stormscript_v$vnum."
Expand Down
3 changes: 2 additions & 1 deletion runtests.sh → scripts/runtests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
cd ..
cmake CMakeLists.txt
make
install stormscript build/stormscript
Expand Down Expand Up @@ -29,7 +30,7 @@ for i in $( ls | grep .sts ); do
else
echo Test $B failed:
echo expected$'\n'$(echo `cat outputs/$i.txt`)$'\n'got$'\n'$(echo `../build/stormscript $i`)
break
exit 1
fi

B=$(($B+1))
Expand Down
1 change: 1 addition & 0 deletions writenewouts.sh → scripts/writenewouts.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
cd ..
cmake CMakeLists.txt
make
install stormscript build/stormscript
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: stormscript # you probably want to 'snapcraft register <name>'
version: 'v0.4.1' # just for humans, typically '1.2+git' or '1.3.2'
version: 'v0.5.0' # just for humans, typically '1.2+git' or '1.3.2'
summary: StormScript is an easy to use, open-source scripting language # 79 char long summary
description: |
StormScript is an open source scripting language. StormScript was created on the belief that a good scripting language can be both powerful and easily readable and learnable.
Expand Down
Loading

0 comments on commit d5415d5

Please sign in to comment.