Giter Club home page Giter Club logo

wurstscript's Introduction

WurstScript

Wurstscript is a delicious programming language which compiles to Jass or Lua code that is used to power WarCraft III maps.

Build Status CircleCI GitHub issues GitHub pull requests Coverage Status

User Documentation

Using WurstScript to build a map is easy! Check out the Setup Guide on how to get started. For a formal description of all language features, visit the Manual.

Consider joining the WurstScript community on Discord.

Reporting Bugs

Please report any bugs your encounter with our Issue Tracker. Include as much information as possible, ideally with logs. Logfiles are located in your home folder under ~/.wurst/logs. Find the last modified file and pastebin it's contents.

Contributing

See https://github.com/wurstscript/WurstScript/blob/master/CONTRIBUTING.md

System Overview

This repository contains the following sub-projects:

  • de.peeeq.wurstscript
    • The core wurstscript compiler and directly related tools
  • Wurstpack
    • (deprecated) Wurst integration for the Warcraft III World Editor
  • HelperScripts
    • Some external scripts used for generating data e.g. for StdLib

IDE support is provided via a VSCode plugin: https://github.com/wurstscript/wurst4vscode

The source for the wurstscript website can be found here: https://github.com/wurstscript/wurstscript.github.io

Compiler Build Process

Java 11+ is required to build the project. Clone the repository and open the de.peeeq.wurstscript folder which contains the compiler project.

Using Gradle

Use the gradle wrapper to run required tasks, it will download gradle automatically. Replace [task_name] with the desired task.

.\gradlew [task_name]

Examples

To update the local compiler installation used by vscode run

.\gradlew make_for_userdir

For deploying .jars and .zips see tasks in deploy.gradle

.\gradlew create_zip_wurstpack_compiler

Import into IDE

You can import the compiler project into any IDE that provides a gradle plugin. For IntelliJ IDEA, you can simply execute ./gradlew openIdea. To run the Test Suite, execute AllTests.xml with TestNG.

Publishing a new release

Jenkins auto-releases versions as major.minor.patch.hotfix-jenkins-Wurst-buildNumber - e.g. 1.8.1.0-jenkins-Wurst-1248.

The version string can be updated in build.gradle.

wurstscript's People

Contributors

cokemonkey11 avatar crigges avatar donach avatar frotty avatar jampi0n avatar jmrico01 avatar karlek avatar krypt0n avatar luizbills avatar menag avatar muzzel avatar nichts avatar ogerlord avatar peq avatar peterzeller avatar thecadorn avatar triplesix0209 avatar wareditorgit avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

wurstscript's Issues

vscode plugin: Quickfixes

We need

  • adding imports automatically
  • being able to generate stub functions when hovering a reference to a non-existing one

Add constant arrays ( sized + init )

Would function as follows:

constant in array[size] = {1,2,3,4}
// can either set in an initblock or instantly

Because it is sized all these constant array can be merged to 1 by wurst.

Add Switch

It would also be nice to have some kind of switch statement:

switch state
    case initial
        bla
    case following | flying
        blub

Add enums

An enum is a list of constants which are translated to ints

example:

enum State
    initial
    following
    flying

Fix for loop for groups

for unit u in group g
-> unit gets not removed //probably working
for unit u from group g
-> unit gets removed from group //not working

Packages <-> CompilationUnits

  • The compilation unit should be named like the package (imo)
  • only allow 1 package per file (imo)

Another question is whether it should be possible to use the java style for packages. So there would be no endpackage keyword and no increased indentation.

Super Function Calls

Implement it :)
e.g.

public class A
    int v 

    function someFunc()
        v++

public class B extends A
    int b

    override function someFunc()
        super.someFunc()
        b += v

Fix wurst.config

or provide an other way to import external wurst files into a map. Possible solutions:

  1. write down a path relative to the map in the mapscript
  2. always include ./wurst/ relative to the map file (or some other folder)

Optimizer changes Condition to Filter

before optimization:

function init_FireballSpell takes nothing returns nothing
    set t_2 = null
    set PERIOD = 0.031250000
    set instanceCount = 0
    set triggerCond = null
    set cond = Condition(function FireballSpell_onExpire)
    call FireballSpell_registerSpellEvent(1093677104)
endfunction

after optimization:

function Fa takes nothing returns nothing
    set es = null
    set Pr = 0.031250000
    set Dr = 0
    set Hr = null
    set ss = Filter(function To)
    call Sa(1093677104)
endfunction

This causes a pjass error.

function overloading

example:

function print( string msg )

function print( unit u )

etc.

Would be cool

Annyoing AutoComplete Issues

If you just type a number, e.g. a real value

real r = 800.

with the "." dot, autocomplete pops up with useless suggestions

There is no autocomplete for creating new classinstances

Fx fx = new Fx( //need autocomplete here plox

Also, it mostly suggest alot of useless/wrong things.
For example for units

unit u = null
u. // Suggest tons of functions which aren't extension functions, also locals in the current function, 
    // what sense makes that?

Also it does not find inherited classmembers

class A
    int i

class B extends A
   function foo()
        this. // "i" doesn't show up

It suggests natives outside of functions.

Weird Compile Behaviour In Plugin

Atm, I inserted an error into Collider.wurst.
because I couldn't fix it a adjusted another file, and when I saved Fx.wurst, the errors in Collider got deleted and I needed
to modify Collider & save in order to display the errors again.
It is quite annoying that you have to save in order to see the errors, many times save doesn't work and other/wrong errors get displayed.
Need a shortcut for compiling.

Eclipse Plugin Broken

Newest Commit breaks the plugin.
Always throws internal workspace error "An internal error occurred during: "Building workspace".
java.lang.IllegalArgumentException: elem must not be null".

Comment Highlighting (again)

Write (not copy)

/*
    SomeText
    NextLine
*/

NextLine and / are not highlighted.
If you indent "/
" 1 time, it works.

Strange^^

Create icons for eclipse plugin

The eclipse plugin needs at least some icons for

  • the project
  • a wurst file

and maybe some icons for the outline view

put results in EclipseWurstPlugin/resources/icons

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.