/*
 * Convert a string to an integer.
 */

#include <iostream>
#include <stdlib.h>
#include <stdio.h>

using namespace std;

%%{
	machine atoi;
	write data noerror;
}%%

int atoi( char *str )
{
	char *p = str;
	int cs, val = 0;
	bool neg = false;

	%%{
		action see_neg {
			neg = true;
		}

		action add_digit {
			val = val * 10 + (fc - '0');
		}

		main :=
			( '-'@see_neg | '+' )? ( digit @add_digit )+
			'\n' @{ fbreak; };

		# Initialize and execute.
		write init;
		write exec noend;
	}%%

	if ( neg )
		val = -1 * val;

	if ( cs < atoi_first_final )
		cerr << "atoi: there was an error" << endl;

	return val;
};

#define BUFSIZE 1024

int main()
{
	char buf[BUFSIZE];
	while ( fgets( buf, sizeof(buf), stdin ) != 0 ) {
		int value = atoi( buf );
		cout << value << endl;
	}
	return 0;
}

Remove the 'noend' write option. This example is referenced a lot and as a first example it shouldn't contain a special purpose write option like 'noend'.

/*
 * Convert a string to an integer.
 */

#include <stdlib.h>
#include <string.h>
#include <stdio.h>

%%{
	machine atoi;
	write data;
}%%

long long atoi( char *str )
{
	char *p = str, *pe = str + strlen( str );
	int cs;
	long long val = 0;
	bool neg = false;

	%%{
		action see_neg {
			neg = true;
		}

		action add_digit {
			val = val * 10 + (fc - '0');
		}

		main :=
			( '-'@see_neg | '+' )? ( digit @add_digit )+
			'\n';

		# Initialize and execute.
		write init;
		write exec;
	}%%

	if ( neg )
		val = -1 * val;

	if ( cs < atoi_first_final )
		fprintf( stderr, "atoi: there was an error\n" );

	return val;
};

#define BUFSIZE 1024

int main()
{
	char buf[BUFSIZE];
	while ( fgets( buf, sizeof(buf), stdin ) != 0 ) {
		long long value = atoi( buf );
		printf( "%lld\n", value );
	}
	return 0;
}


/*
 * @LANG: c
 *
 * Tests fnext in combination with fbreak.
 */

#include <string.h>
#include <stdio.h>

char comm;
int top;
int stack [32];

%%{
    machine fnext;
	action break {fbreak;}

	main := 'h'   @{ /*h*/  fnext e; fbreak; };
	e    := 'e'   @{ /*e*/  fnext l; }   @{ fbreak; };
	l    := 'll'  @{ /*ll*/ fnext o; }   ${ fbreak; };
	o    := |* 'o' { /*o*/  fnext nl; fbreak; }; *|;
	nl   := '\n'  @{ /*nl*/ fbreak; printf("ACCEPT\n"); };
}%%

int cs;
char *ts, *te;
int act;

%% write data;

void init()
{
	%% write init;
}

void exec( char *data, int len )
{
	char *p = data;
	char *pe = data + len;

	while ( cs != fnext_error && p < pe ) {
		printf( "%c\n", *p );
		%% write exec;
	}
}

void finish( )
{
	if ( cs >= fnext_first_final )
		printf( "ACCEPT\n" );
	else
		printf( "FAIL\n" );
}

char *inp[] = {
	"hello\n"
};

int inplen = 1;

int main( )
{
	int i;
	for ( i = 0; i < inplen; i++ ) {
		init();
		exec( inp[i], strlen(inp[i]) );
		finish();
	}
	return 0;
}

#ifdef _____OUTPUT_____
h
e
l
l
o

ACCEPT
#endif


Add initial ragel grammar based on Stomp 1.2 ABNF

module Stompede
  module Stomp
    %%{
      machine Message;

      NULL = "\0";
      LF = "\n";
      CR = "\r";
      EOL = CR? LF;
      OCTET = any;

      client_command = "SEND" | "SUBSCRIBE" | "UNSUBSCRIBE" | "BEGIN" | "COMMIT" | "ABORT" | "ACK" | "NACK" | "DISCONNECT" | "CONNECT" | "STOMP";
      server_command = "CONNECTED" | "MESSAGE" | "RECEIPT" | "ERROR";
      command = client_command | server_command;

      header_component = (OCTET - CR - LF - ":")+;
      header_name = header_component+;
      header_value = header_component*;
      header = header_name+ ":" header_value;

      frame = command EOL (header EOL)* EOL OCTET* NULL;

      main := frame;
    }%%

    def self.parse(message)
      %% write data;
      %% write init;
      %% write exec;
    end
  end
end


#!/bin/bash
#SBATCH --job-name="AdaptiveTest"
#SBATCH -D .
#SBATCH --output=AdaptiveTest.out
#SBATCH --error=AdaptiveTest.err
#SBATCH --ntasks=4
#SBATCH --time=00:40:00
#SBATCH --qos=debug

python runAllTests.py

Change number of processors in tests run file

#!/bin/bash
#SBATCH --job-name="AdaptiveTest"
#SBATCH -D .
#SBATCH --output=AdaptiveTest.out
#SBATCH --error=AdaptiveTest.err
#SBATCH --ntasks=5
#SBATCH --time=00:40:00
#SBATCH --qos=debug

python runAllTests.py


<%
# Test for issue #10
# NoMethodError: Undefined method '[]' on #<Method:0x2348bc8>
# https://github.com/slash-lang/slash/issues/10

class Issue10RegressionTest extends Test {
  def test_map_after_method_definition {
    assert_equal([1, 4, 9], \{
      def baloney {
        ...;
      }

      [1, 2, 3].map(\n { n * n});
    }.call);
  }
}.register;

Update issue description in header

<%
# Test for issue #10
# An array operation immediately after a method declaration
# confuses slash into thinking the [] method should operate
# on the previously declared Method.
# Link: https://github.com/slash-lang/slash/issues/10
class Issue10RegressionTest extends Test {
  def test_map_after_method_definition {
    assert_equal([1, 4, 9], \{
      def baloney {
        ...;
      }

      [1, 2, 3].map(\n { n * n});
    }.call);
  }
}.register;


-parse -fileunit rtl/i2c_master_bit_ctrl.v rtl/i2c_master_byte_ctrl.v rtl/	i2c_master_top.v  +incdir+rtl/+.

Fix bad input in sl file

-parse -fileunit rtl/i2c_master_bit_ctrl.v rtl/i2c_master_byte_ctrl.v rtl/i2c_master_top.v +incdir+rtl/+.


#!/bin/bash -l

#SBATCH -N 1
#SBATCH -p regular
#SBATCH -t 00:45:00
#SBATCH -C knl,quad,cache

export KMP_AFFINITY=granularity=fine,compact
export NUM_OF_THREADS=$(grep 'model name' /proc/cpuinfo | wc -l)
export OMP_NUM_THREADS=$(( $NUM_OF_THREADS / 4  ))
export MKL_NUM_THREADS=$(( $NUM_OF_THREADS / 4  ))
export KMP_HW_SUBSET=${OMP_NUM_THREADS}c,1t
export HPL_LARGEPAGE=1
export KMP_BLOCKTIME=800
export TEST=all
export SIZE=large
export OUTPUT_DIR="."

module load python/3.5-anaconda
source $HOME/.conda/envs/wrapped_ibench/bin/activate wrapped_ibench

# Make sure that the transparent huge page is enabled for best performance
module load craype-hugepages2M

#### This is a script for running the benchmark
srun -N 1 python -m ibench run -b $TEST --size $SIZE --file \
$OUTPUT_DIR/${TEST}_${SIZE}_$(date '+%Y-%m-%d_%H:%M:%S').log

Add comments to clarify the steps

#!/bin/bash -l

#SBATCH -N 1
#SBATCH -p regular
#SBATCH -t 00:45:00
#SBATCH -C knl,quad,cache

# specify threading settings
export KMP_AFFINITY=granularity=fine,compact
export NUM_OF_THREADS=$(grep 'model name' /proc/cpuinfo | wc -l)
export OMP_NUM_THREADS=$(( $NUM_OF_THREADS / 4  ))
export MKL_NUM_THREADS=$(( $NUM_OF_THREADS / 4  ))
export KMP_HW_SUBSET=${OMP_NUM_THREADS}c,1t
export HPL_LARGEPAGE=1
export KMP_BLOCKTIME=800
export TEST=all
export SIZE=large
export OUTPUT_DIR="."

# load the python module on Cori
module load python/3.5-anaconda

# activate the relevant Conda environment
source $HOME/.conda/envs/wrapped_ibench/bin/activate wrapped_ibench

# make sure that the Cray transparent huge page module is loaded for the best performance
module load craype-hugepages2M

# run the benchmark and specify the location and name of the log file
srun -N 1 python -m ibench run -b $TEST --size $SIZE --file \
$OUTPUT_DIR/${TEST}_${SIZE}_$(date '+%Y-%m-%d_%H:%M:%S').log


#include <amxmodx>

public made_hs(id){
  // Get Killer information:
  new killer = read_data(1)

  new nameK[32]
  get_user_name(killer, nameK ,31 )

  new authidK[32]
  get_user_authid(killer, authidK , 31 )

  new teamK[11]
  get_user_team(killer, teamK, 10)

  // Get Victim information:
  new victim = read_data(2)

  new nameV[32]
  get_user_name(victim, nameV ,31 )

  new authidV[32]
  get_user_authid(victim, authidV , 31 )

  new teamV[11]
  get_user_team(victim, teamV, 10)

  // Log head shot event with all corresponding information
  // TODO: Log waepon
  log_message("^"%s<%d><%s><%s>^" made a HS on ^"%s<%d><%s><%s>^"",nameK,killer,authidK,teamK,nameV,victim,authidV,teamV)

  return PLUGIN_CONTINUE
}

public plugin_init(){
   register_plugin("Headshot logger","0.0.1","MeMeK")
   register_event   ("DeathMsg","made_hs","ade", "3=1", "5=0" )
   return PLUGIN_CONTINUE
}


#include <amxmodx>
#include <curl>

#pragma semicolon 1
#pragma ctrlchar '\'

public plugin_init()
{
    register_plugin("HTTP: Post request", "1.0.0", "gamingEx aka. Kaido Ren");
    @requestBegin();
}

enum dataStruct { curl_slist: linkedList };

@requestBegin()
{
    new CURL: pCurl, curl_slist: pHeaders, sData[dataStruct];

    pHeaders = curl_slist_append(pHeaders, "Content-Type: application/json");
    pHeaders = curl_slist_append(pHeaders, "User-Agent: curl");

    sData[linkedList] = pHeaders;

    if ((pCurl = curl_easy_init())) {
        curl_easy_setopt(pCurl, CURLOPT_URL, "http://jsonplaceholder.typicode.com/posts");
        curl_easy_setopt(pCurl, CURLOPT_COPYPOSTFIELDS, "{\"title\": \"foo\", \"body\": \"bar\", \"userId\": 1}");
        curl_easy_setopt(pCurl, CURLOPT_CUSTOMREQUEST, "POST");
        curl_easy_setopt(pCurl, CURLOPT_HTTPHEADER, pHeaders);
        curl_easy_setopt(pCurl, CURLOPT_WRITEFUNCTION, "@responseWrite");

        curl_easy_perform(pCurl, "@requestComplete", sData, dataStruct);
    }
}

@responseWrite(const data[], const size, const nmemb)
{
    server_print("Response body: \n%s", data);

    return size * nmemb; // tell curl how many bytes we handled
}

@requestComplete(CURL: curl, CURLcode: code, const data[dataStruct])
{
    if (code != CURLE_OK) {
        new szError[128];
        curl_easy_strerror(code, szError, charsmax(szError));
        server_print("CURL: %s", szError);
    }

    curl_easy_cleanup(curl);
    curl_slist_free_all(data[linkedList]);
}


Add the beginnings of a Richards benchmark.

; Based on V8 JavaScript richards

ID_IDLE:       0,
ID_WORKER:     1,
ID_HANDLER_A:  2,
ID_HANDLER_B:  3,
ID_DEVICE_A:   4,
ID_DEVICE_B:   5,
NUMBER_OF_IDS: 6,

COUNT:         10000,

EXPECTED_QUEUE_COUNT: 23246,
EXPECTED_HOLD_COUNT: 9297,

STATE_RUNNING:   0,
STATE_RUNNABLE:  1,
STATE_SUSPENDED: 2,
STATE_HELD:      4,
STATE_SUSPENDED_RUNNABLE: STATE_SUSPENDED | STATE_RUNNABLE,
STATE_NOT_HELD: -5,

DATA_SIZE: 4,

; The Richards benchmark simulates the task dispatcher of an
; operating system.
runRichards = #(
  scheduler = Scheduler create
  queue = Packet create(nil, ID_WORKER, :work)
  workerQueue = Packet create(queue, ID_WORKER, :work)

  queue = Packet create(nil,   ID_DEVICE_A, :device)
  queue = Packet create(queue, ID_DEVICE_A, :device)
  handlerQueue = Packet create(queue, ID_DEVICE_A, :device)

  queue = Packet create(nil,   ID_DEVICE_B, :device)
  queue = Packet create(queue, ID_DEVICE_B, :device)
  handlerQueue2 = Packet create(queue, ID_DEVICE_B, :device)

  s0 = scheduler withIdleTask(ID_IDLE, 0, nil, COUNT)
  s1 = s0        withWorkerTask(ID_WORKER, 1000, workerQueue)
  s2 = s1        withHandlerTask(ID_HANDLER_A, 2000, handlerQueue)
  s3 = s2        withHandlerTask(ID_HANDLER_B, 3000, handlerQueue2)
  s4 = s3        withDeviceTask(ID_DEVICE_A, 4000, nil)
  s5 = s4        withDeviceTask(ID_DEVICE_B, 5000, nil)

  result = s5 schedule!

  if(result queueCount != EXPECTED_QUEUE_COUNT || result holdCount != EXPECTED_HOLD_COUNT,
    "Error during execution: queueCount = #{result  queueCount}, holdCount = #{result holdCount}." println)
)


fin = file(vargv[0], "r")
fout = file(vargv[1], "w")

prefix = "sq"
while (l = fin.readline()) {
    if (l.find("/*stdlib*/"))
        prefix = "sqstd"

    if (!l.find("(*"))
        continue

    toks = split(l, "()")
    sym = toks[1].slice(1)
    fout.write("#define " + prefix + "_" + sym + " (sqapi->" + sym + ")\n")
}

Update script for vargs[0] being a script name.

fin = file(vargv[1], "r")
fout = file(vargv[2], "w")

prefix = "sq"
while (l = fin.readline()) {
    if (l.find("/*stdlib*/"))
        prefix = "sqstd"

    if (!l.find("(*"))
        continue

    toks = split(l, "()")
    sym = toks[1].slice(1)
    fout.write("#define " + prefix + "_" + sym + " (sqapi->" + sym + ")\n")
}


Add test for accessing variables (errno).

_import_("../ffi")

libc = load("libc.so.6")

errno = libc.var("i", "errno")
assert(errno.get() == 0)
print("errno: " + errno.get() + "\n")

function wrap(rett, funcn, paramt) {
    getroottable()[funcn] = libc.func(rett, funcn, paramt)
}

wrap("i", "socket", ["i", "i", "i"])
wrap("i", "perror", ["s"])

# Random, diffenitily unsupported values
s = socket(100, 100, 100)
print("errno: " + errno.get() + "\n")
perror("perror")
# EINVAL
assert(errno.get() == 22)


Add trivial templates aka server pages implementation.

#
# This is simple(?) convertor for "Squirrel server pages" to Squirrel code.
# Supported syntax:
# <? code ?> - inline Squirrel code
# <?= value ?> - output Squirrel value (equivalent to <? print(value) ?>)
# The page received parameters from caller in dictionary named "d".
# Simple example:
#
# Hello <?= d.name ?>!
# <? for (i = 0; i < 5; i++) { ?>
# i = <?= i ?>
# <? } ?>
#

const TEXT = 1
const CODE = 2
const PRINT = 3
# Character to use after < and before > for inline code
const MARKER = "?"

function start_page() {
    print("function render(d) {\n");
}
function stop_page() {
    print("}\n");
    print("render({\"name\": \"test\"})\n");
}
function start_text() {
    print("print(@\"");
}
function stop_text() {
    print("\")\n");
}
function start_print() {
    print("print(");
}
function stop_print() {
    print(")\n");
}

function process(f) {
    local c;
    local state = TEXT

    start_page()
    start_text()
    while (c = f.read(1)) {
        if (c == "<") {
            c2 = f.read(1)
            if (c2 == MARKER) {
                stop_text()
                state = CODE
                c = f.read(1)
                if (c == "=") {
                    state = PRINT
                    start_print()
                    continue
                }
                print(c)
                continue
            }
            print(c)
            c = c2
        } else if (c == MARKER) {
            c2 = f.read(1)
            if (c2 == ">") {
                local old_state = state;
                if (old_state == PRINT)
                    stop_print()
                start_text()
                state = TEXT
                // Eat newline after closing code bracket, but not print bracket
                if (old_state == PRINT)
                    continue
                c = f.read(1)
                if (c == "\n")
                    continue
            }
            print(c)
            c = c2
        }
        print(c);
    }
    if (state == TEXT)
        stop_text()
    stop_page()
}

f = file(vargv[1], "r")
process(f)
f.close()


Add initial working version of HTTP client module.

import("socket")

DEFLEN = 4096

class chainstream {

    streams = null;

    constructor(...) {
        streams = vargv
    }
}

class HTTPResponse {

    sock = null
    status = null
    headers = null

    constructor(sock) {
        this.sock = sock
    }

    function read_headers() {
        headers = {}
        local l
        status = sock.readline()
        while ((l = sock.readline()) != "\r\n") {
            l = l.slice(0, -2)
            l = split(l, ":")
            l[1] = strip(l[1])
            headers[l[0]] = l[1]
        }
    }

    function read(len = DEFLEN) {
        if (headers == null)
            read_headers()
        return sock.read(len)
    }
}

class HTTPClient {

    server = null;
    s = null;

    constructor(server) {
        this.server = server
    }

    function request(method, uri) {
        local s = socket.Socket(server, 80)
        s.write(method + " " + uri + " HTTP/1.0\r\n\r\n")
        return HTTPResponse(s)
    }
}

h = HTTPClient([127, 0, 0, 1])
r = h.request("GET", "/")
print(r.read(50))
print(r.read())
print("------------\n")
print("*Status*:" + r.status)
foreach (k, v in r.headers)
    print(k + "=" + v + "\n")


SmalltalkCISpec {
  #loading : [
    SCIMetacelloLoadSpec {
      #baseline : 'NewBloc',
      #directory : 'src',
      #platforms : [ #pharo ]
    }
  ],
	#testing : {
		#packages : [ 'Bloc.*' ],
		#coverage : {
			#packages : [ 'Bloc.*' ]
		}
	}
}

Revert coverage (cause of crash?)

SmalltalkCISpec {
  #loading : [
    SCIMetacelloLoadSpec {
      #baseline : 'NewBloc',
      #directory : 'src',
      #platforms : [ #pharo ]
    }
  ],
	#testing : {
		#packages : [ 'Bloc.*' ]
	}
}


SmalltalkCISpec {
  #loading : [
    SCIMetacelloLoadSpec {
      #baseline : 'IssueIntegration',
      #directory : 'packages',
      #load : [ 'Tests' ],
      #platforms : [ #squeak ]
    }
  ],
  #testing: {
    #coverage : {
      #categories : [ 'IssueIntegration-*' ]
    },
    #exclude : {
      #classes : [ #JsonTests ]
    }
  }
}

Exclude TestServer from code coverage analysis.

SmalltalkCISpec {
  #loading : [
    SCIMetacelloLoadSpec {
      #baseline : 'IssueIntegration',
      #directory : 'packages',
      #load : [ 'Tests' ],
      #platforms : [ #squeak ]
    }
  ],
  #testing: {
    #coverage : {
      #categories : [ 'IssueIntegration-Core', 'IssueIntegration-UI' ]
    },
    #exclude : {
      #classes : [ #JsonTests ]
    }
  }
}


SmalltalkCISpec {
  #loading : [
    SCIMetacelloLoadSpec {
      #baseline : 'OpenSqueakMap',
      #directory : 'packages',
	  #load : [ 'TravisCI' ],
      #platforms : [ #squeak ]
    }
  ]
}

Make sure travis gets to use the latest metacello

SmalltalkCISpec {
  #loading : [
    SCIMetacelloLoadSpec {
      #baseline : 'OpenSqueakMap',
      #directory : 'packages',
	  #load : [ 'TravisCI' ],
      #platforms : [ #squeak ],
      #useLatestMetacello : true
    }
  ]
}


SmalltalkCISpec {
  #loading : [],
  #testing : {
    #allTestCases : true,
    #defaultTimeout : 10,
    #exclude : {
      #classes : [
        #BrowserTest,
        #ClosureCompilerTest,
        #DecompilerTests,
        #ExceptionTests,
        #FileList2ModalDialogsTest,
        #FontTest,
        #IslandVMTweaksTestCase,
        #LangEnvBugs,
        #LocaleTest,
        #MVCToolBuilderTests,
        #PackageDependencyTest,
        #SocketTest,
        #SqueakSSLTest,
        #StandardSystemFontsTest,
        #UnimplementedCallBugz,
        #WebClientServerTest,

        #FileHandleTest,
        #GLMTextMorphicTest,
        #GTSpotterStepFilteringTest,
        #GTSpotterTest,
        #NetNameResolverTest,
        #PharoIssueTest,
        #ReleaseTest,
        #SimulateMouseSpecification,
        #ZnCharacterEncoderTests,
        #ZnResponseTests
      ],
      #categories : [ 'TxText*' ]
    }
  }
}

Hide passing tests from stdout

SmalltalkCISpec {
  #loading : [],
  #testing : {
    #allTestCases : true,
    #defaultTimeout : 10,
    #hidePassingTests : true,
    #exclude : {
      #classes : [
        #BrowserTest,
        #ClosureCompilerTest,
        #DecompilerTests,
        #ExceptionTests,
        #FileList2ModalDialogsTest,
        #FontTest,
        #IslandVMTweaksTestCase,
        #LangEnvBugs,
        #LocaleTest,
        #MVCToolBuilderTests,
        #PackageDependencyTest,
        #SocketTest,
        #SqueakSSLTest,
        #StandardSystemFontsTest,
        #UnimplementedCallBugz,
        #WebClientServerTest,

        #FileHandleTest,
        #GLMTextMorphicTest,
        #GTSpotterStepFilteringTest,
        #GTSpotterTest,
        #NetNameResolverTest,
        #PharoIssueTest,
        #ReleaseTest,
        #SimulateMouseSpecification,
        #ZnCharacterEncoderTests,
        #ZnResponseTests
      ],
      #categories : [ 'TxText*' ]
    }
  }
}


SmalltalkCISpec {
  #loading : [
    SCIMetacelloLoadSpec {
      #baseline : 'PharoJS',
	  #repository : 'http://smalltalkhub.com/mc/noury/PharoJS/main',
	  #onWarningLog : true,
      #platforms : [ #pharo]
    }
  ]
}

Use configuration instead of baseline in ston

SmalltalkCISpec {
  #loading : [
    SCIMetacelloLoadSpec {
      #configuration : 'PharoJS',
	  #repository : 'http://smalltalkhub.com/mc/noury/PharoJS/main',
	  #onWarningLog : true,
      #platforms : [ #pharo]
    }
  ]
}


SmalltalkCISpec {
  #loading : [
    SCIMetacelloLoadSpec {
      #baseline : 'RenrakuSmoke',
      #directory : '',
      #platforms : [ #pharo ]
    }
  ],

  #testing : {
    #packages : [ 'Renraku.*' ]
  }
}

Use categories instead of packages in ci conf

SmalltalkCISpec {
  #loading : [
    SCIMetacelloLoadSpec {
      #baseline : 'RenrakuSmoke',
      #directory : '',
      #platforms : [ #pharo ]
    }
  ],

  #testing : {
    #categories : [ 'Renraku-*' ]
  }
}


using Uno;
using Uno.Collections;
using Uno.UX;
using Uno.Text;

namespace Fuse.Reactive
{
	/** Creates an `IArray` from an arbitrary number of arguments.
		An `IArray` can be automatically marshalled to any Uno vector type (e.g. `float4`)
	*/
	public class Vector: SimpleVarArgFunction
	{
		protected override void OnNewArguments(Argument[] args, IListener listener)
		{
			listener.OnNewData(this, new Array(args));
		}

		class Array: IArray
		{
			object[] _items;
			public Array(Argument[] args)
			{
				_items = new object[args.Length];
				for (var i = 0; i < args.Length; i++)
					_items[i] = args[i].Value;
			}
			object IArray.this[int index] { get { return _items[index]; } }
			int IArray.Length { get { return _items.Length; } }

			public override string ToString()
			{
				var sb = new StringBuilder();
				sb.Append("(");
				for (var i = 0; i < _items.Length; i++)
				{
					if (i > 0) sb.Append(", ");
					sb.Append(_items[i].ToString());
				}
				sb.Append(")");
				return sb.ToString();
			}
		}
	}
}

Implement VectorFunction.FormatString to satisfy test

using Uno;
using Uno.Collections;
using Uno.UX;
using Uno.Text;

namespace Fuse.Reactive
{
	/** Creates an `IArray` from an arbitrary number of arguments.
		An `IArray` can be automatically marshalled to any Uno vector type (e.g. `float4`)
	*/
	public class Vector: SimpleVarArgFunction
	{
		protected override void OnNewArguments(Argument[] args, IListener listener)
		{
			listener.OnNewData(this, new Array(args));
		}

		class Array: IArray
		{
			object[] _items;
			public Array(Argument[] args)
			{
				_items = new object[args.Length];
				for (var i = 0; i < args.Length; i++)
					_items[i] = args[i].Value;
			}
			object IArray.this[int index] { get { return _items[index]; } }
			int IArray.Length { get { return _items.Length; } }

			public override string ToString()
			{
				var sb = new StringBuilder();
				sb.Append("(");
				for (var i = 0; i < _items.Length; i++)
				{
					if (i > 0) sb.Append(", ");
					sb.Append(_items[i].ToString());
				}
				sb.Append(")");
				return sb.ToString();
			}
		}

		public override string ToString()
		{
			return FormatString("");
		}
	}
}


using Uno;
using Uno.UX;
using Uno.Testing;

using Fuse.Controls;
using FuseTest;

namespace Fuse.Reactive.Test
{
	public class JavaScriptTest : TestBase
	{
		[Test]
		public void Names()
		{
			var j = new UX.JavaScript.Names();
			using (var root = TestRootPanel.CreateWithChild(j))
			{
				root.StepFrameJS();

				j.callGo.Perform();
				root.StepFrameJS();
				Assert.AreEqual("yes", j.text.Value);
			}
		}

		[Test]
		//future-proofing any cleanup of exported names (this uses unusual, but valid JS names)
		//refer to https://github.com/fusetools/fuselibs-public/issues/972
		public void ExoticNames()
		{
			var j = new UX.JavaScript.ExoticNames();
			using (var root = TestRootPanel.CreateWithChild(j))
			{
				root.StepFrameJS();

				j.callGo.Perform();
				root.StepFrameJS();
				Assert.AreEqual("yes", j.text1.Value);
				Assert.AreEqual("yes", j.text2.Value);
				Assert.AreEqual("yes", j.text3.Value);
			}
		}
	}
}

Exclude broken test from MSVC build

using Uno;
using Uno.UX;
using Uno.Testing;

using Fuse.Controls;
using FuseTest;

namespace Fuse.Reactive.Test
{
	public class JavaScriptTest : TestBase
	{
		[Test]
		public void Names()
		{
			var j = new UX.JavaScript.Names();
			using (var root = TestRootPanel.CreateWithChild(j))
			{
				root.StepFrameJS();

				j.callGo.Perform();
				root.StepFrameJS();
				Assert.AreEqual("yes", j.text.Value);
			}
		}

		// NOTE: This test is excluded on MSVC since the compiler used for that target apparently
		// don't properly support unicode symbols. We're not using the [Ignore] attribute here
		// since that won't exclude the test during compilation.
		[Test]
		//future-proofing any cleanup of exported names (this uses unusual, but valid JS names)
		//refer to https://github.com/fusetools/fuselibs-public/issues/972
		extern(!MSVC) public void ExoticNames()
		{
			var j = new UX.JavaScript.ExoticNames();
			using (var root = TestRootPanel.CreateWithChild(j))
			{
				root.StepFrameJS();

				j.callGo.Perform();
				root.StepFrameJS();
				Assert.AreEqual("yes", j.text1.Value);
				Assert.AreEqual("yes", j.text2.Value);
				Assert.AreEqual("yes", j.text3.Value);
			}
		}
	}
}


(import [object? vector? keys vals dec] "../lib/runtime")

(def to-string Object.prototype.to-string)

(defn ^boolean date?
  "Returns true if x is a date"
  [x]
  (identical? (.call to-string x) "[object Date]"))

(defn ^boolean equivalent?
  [actual expected]
  (or
   (identical? actual expected)
   (and (= actual expected))
   (and (date? actual)
        (date? expected)
        (= (.get-time actual)
           (.get-time expected)))
   (if (and (vector? actual) (vector? expected))
     (and (= (.-length actual)
             (.-length expected))
          (loop [index (dec (.-length actual))]
            (if (< index 0)
              true
              (if (equivalent?
                   (get actual index)
                   (get expected index))
                (recur (dec index))
                false))))
     (and (object? actual)
          (object? expected)
          (equivalent? (keys actual)
                       (keys expected))
          (equivalent? (vals actual)
                       (vals expected))))))

(export equivalent? date?)

Update equivalent? function to make it indifferent of key, value order.

(import [object? vector? keys vals dec] "../lib/runtime")

(def to-string Object.prototype.to-string)

(defn ^boolean date?
  "Returns true if x is a date"
  [x]
  (identical? (.call to-string x) "[object Date]"))

(defn ^boolean equivalent?
  [actual expected]
  (or
   (identical? actual expected)
   (and (= actual expected))
   (and (date? actual)
        (date? expected)
        (= (.get-time actual)
           (.get-time expected)))
   (if (and (vector? actual) (vector? expected))
     (and (= (.-length actual)
             (.-length expected))
          (loop [index (dec (.-length actual))]
            (if (< index 0)
              true
              (if (equivalent?
                   (get actual index)
                   (get expected index))
                (recur (dec index))
                false))))
     (and (object? actual)
          (object? expected)
          (equivalent? (.sort (keys actual))
                       (.sort (keys expected)))
          (equivalent? (.sort (vals actual))
                       (.sort (vals expected)))))))

(export equivalent? date?)


(defun 1+ (n)
  (+ 1 n))

(defun length (lst)
  (if (nullp lst)
      0
    (1+ (length (cdr lst)))))

(defmacro setq (var val)
  (list (quote set) (list (quote quote) var) val))

;; The provided function should be able to accept a single argument
(defun reduce (f lst)
  (if (= (length lst) 1)
      (f (car lst))
    (f (car lst) (reduce f (cdr lst)))))

(defun apply (f lst)
  (if (not (listp lst))
      (throw 'wrong-type-argument lst)
    (eval (cons f lst))))

Update setq definition to use new quoting.

(defun 1+ (n)
  (+ 1 n))

(defun length (lst)
  (if (nullp lst)
      0
    (1+ (length (cdr lst)))))

(defmacro setq (var val)
  (list 'set (list 'quote var) val))

;; The provided function should be able to accept a single argument
(defun reduce (f lst)
  (if (= (length lst) 1)
      (f (car lst))
    (f (car lst) (reduce f (cdr lst)))))

(defun apply (f lst)
  (if (not (listp lst))
      (throw 'wrong-type-argument lst)
    (eval (cons f lst))))


(import fs "fs")
(import [rest] "../sequence")
(import [str] "../runtime")
(import [read-from-string] "../reader")
(import [compile-program] "../compiler")

(defn transpile
  [source uri]
  (str (compile-program
        ;; Wrap program body into a list in order to to read
        ;; all of it.
        (rest (read-from-string (str "(do " source ")") uri))) "\n"))

;; Register `.wisp` file extension so that
;; modules can be simply required.
(set! (get require.extensions ".wisp")
  (fn [module uri]
    (._compile module
               (transpile (.read-file-sync fs uri :utf8))
               uri)))

(export transpile)

Use `**verbose**` mode if wisp started with `--verbose` flag.

(import fs "fs")
(import [rest] "../sequence")
(import [str] "../runtime")
(import [read-from-string] "../reader")
(import [compile-program] "../compiler")

(set! global.**verbose** (<= 0 (.indexOf process.argv :--verbose)))

(defn transpile
  [source uri]
  (str (compile-program
        ;; Wrap program body into a list in order to to read
        ;; all of it.
        (rest (read-from-string (str "(do " source ")") uri))) "\n"))

;; Register `.wisp` file extension so that
;; modules can be simply required.
(set! (get require.extensions ".wisp")
  (fn [module uri]
    (._compile module
               (transpile (.read-file-sync fs uri :utf8))
               uri)))

(export transpile)


USING System.Collections
USING System.Collections.Generic
USING System.Windows.Forms
USING System.IO
USING Xide
USING XSharpModel
BEGIN NAMESPACE XSharp.VOEditors

CLASS XSharpDesignWindowItem inherit DesignWindowItem

	CONSTRUCTOR( oDesigner as VOWindowEditor, oTemplate as VOControlTemplate)
		SUPER(oDesigner , oTemplate)

	METHOD GetVOStylesString(eVOStyle as VOStyle ) as STRING
		LOCAL cResult := SUPER:GetVOStylesString(eVOStyle) AS STRING
		LOCAL oXSharpDesigner as XSharp_VOWindowEditor
		oXSharpDesigner := SELF:oDesigner astype XSharp_VOWindowEditor
		IF !String.IsNullOrEmpty(cResult) .and. oXSharpDesigner != NULL_OBJECT
			LOCAL aStyles := cResult:Split("|":ToCharArray()) AS STRING[]
			oXSharpDesigner:AddStyles(aStyles)
		ENDIF
		return cResult

END CLASS
END NAMESPACE

Add WS_VISIBLE. This is not a normal style but added with NOT later when a control is invisible

USING System.Collections
USING System.Collections.Generic
USING System.Windows.Forms
USING System.IO
USING Xide
USING XSharpModel
BEGIN NAMESPACE XSharp.VOEditors

CLASS XSharpDesignWindowItem inherit DesignWindowItem

	CONSTRUCTOR( oDesigner as VOWindowEditor, oTemplate as VOControlTemplate)
		SUPER(oDesigner , oTemplate)

	METHOD GetVOStylesString(eVOStyle as VOStyle ) as STRING
		LOCAL cResult := SUPER:GetVOStylesString(eVOStyle) AS STRING
		LOCAL oXSharpDesigner as XSharp_VOWindowEditor
		oXSharpDesigner := SELF:oDesigner astype XSharp_VOWindowEditor
		IF !String.IsNullOrEmpty(cResult) .and. oXSharpDesigner != NULL_OBJECT
			LOCAL aStyles := cResult:Split("|":ToCharArray()) AS STRING[]
			oXSharpDesigner:AddStyles(aStyles)
			oXSharpDesigner:AddStyles(<STRING>{"WS_VISIBLE"})
		ENDIF
		return cResult

END CLASS
END NAMESPACE


//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//
USING System
USING System.Collections.Generic
USING System.Linq
USING System.Text
USING XUnit

// Array tests are not working correctly yet with the current build
BEGIN NAMESPACE XSharp.VFP.Tests

	CLASS EmptyTests
        [Fact, Trait("Category", "Empty Class")];
		METHOD EmptyClasstests() AS VOID
            local o as Object
            o := XSharp.VFP.Empty{}
            Assert.Throws( typeof(XSharp.Error), { => o:NonExistingProperty := 123 })
            try
                o:NonExistingProperty := 123
            catch e as exception
                ? e
            end try
            AddProperty(o, "SomeProperty", 42)
            Assert.True( (Int) o:SomeProperty  == 42)
            AddProperty(o, "BestLanguage","X#")
            Assert.True( (string) o:BestLanguage  == "X#")
            RemoveProperty(o, "BestLanguage")
            Assert.Throws( typeof(XSharp.Error), { => o:BestLanguage  == FALSE})
    END CLASS
END NAMESPACE

Fix in VFP empty test

//
// Copyright (c) XSharp B.V.  All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
// See License.txt in the project root for license information.
//
USING System
USING System.Collections.Generic
USING System.Linq
USING System.Text
USING XUnit

// Array tests are not working correctly yet with the current build
BEGIN NAMESPACE XSharp.VFP.Tests

	CLASS EmptyTests
        [Fact, Trait("Category", "Empty Class")];
		METHOD EmptyClasstests() AS VOID
            local o as Object
            o := XSharp.VFP.Empty{}
            Assert.Throws( typeof(XSharp.Error), { => o:NonExistingProperty := 123 })
            try
                o:NonExistingProperty := 123
            catch e as exception
                ? e
            end try
            AddProperty(o, "SomeProperty", 42)
            Assert.True( (Int) o:SomeProperty  == 42)
            AddProperty(o, "BestLanguage","X#")
            Assert.True( (string) o:BestLanguage  == "X#")
            RemoveProperty(o, "BestLanguage")
            Assert.Throws( typeof(XSharp.Error), { => o:BestLanguage  := FALSE})
    END CLASS
END NAMESPACE


procedure select_test1
   assert select() = 1
ENDPROC

Add more library/inlining functionality tests to testbed.

procedure select_tests
   assert select() = 1
   assert select(0) = 1
   assert select(1) = 32767
   assert select(2) = 0
   assert select('test') = 0
ENDPROC

procedure chr_tests
   assert asc(chr(0)) = 0
endproc

procedure set_tests
   assert set('compatible') = 'OFF'
   assert set('compatible', 1) = 'PROMPT'
ENDPROC

procedure used_tests
   assert used('test') = .f.
endproc

procedure date_tests
   local somedate
   somedate = {^2017-6-30}
   assert dow(somedate) == 6
   assert cdow(somedate) == 'Friday'
endproc

procedure math_tests
   assert round(pi(), 2) == 3.14
   assert abs(tan(dtor(45)) - 1) < 0.001
   assert abs(sin(dtor(90)) - 1) < 0.001
   assert abs(cos(dtor(90)) - 0) < 0.001
   assert abs(cos(dtor(45)) - sqrt(2)/2) < 0.001
endproc


/*
  ECMA-262 5th Edition, 15.12.1 The JSON Grammar.
  Modified to forbid top level primitives.
*/

/* author: Zach Carter */

%start JSONText

%%

JSONString
    : STRING
        {$$ = yytext;}
    ;

JSONNumber
    : NUMBER
        {$$ = Number(yytext);}
    ;

JSONNullLiteral
    : NULL
        {$$ = null;}
    ;

JSONBooleanLiteral
    : TRUE
        {$$ = true;}
    | FALSE
        {$$ = false;}
    ;

JSONText
    : JSONValue EOF
        {return $$ = $1;}
    ;

JSONValue
    : JSONNullLiteral
    | JSONBooleanLiteral
    | JSONString
    | JSONNumber
    | JSONObject
    | JSONArray
    ;

JSONObject
    : '{' '}'
        {{$$ = {};}}
    | '{' JSONMemberList '}'
        {$$ = $2;}
    ;

JSONMember
    : JSONString ':' JSONValue
        {$$ = [$1, $3];}
    ;

JSONMemberList
    : JSONMember
        {{$$ = {}; $$[$1[0]] = $1[1];}}
    | JSONMemberList ',' JSONMember
        {$$ = $1; $1[$3[0]] = $3[1];}
    ;

JSONArray
    : '[' ']'
        {$$ = [];}
    | '[' JSONElementList ']'
        {$$ = $2;}
    ;

JSONElementList
    : JSONValue
        {$$ = [$1];}
    | JSONElementList ',' JSONValue
        {$$ = $1; $1.push($3);}
    ;

Remove comment about top level primitives

/*
  ECMA-262 5th Edition, 15.12.1 The JSON Grammar.
*/

/* author: Zach Carter */

%start JSONText

%%

JSONString
    : STRING
        {$$ = yytext;}
    ;

JSONNumber
    : NUMBER
        {$$ = Number(yytext);}
    ;

JSONNullLiteral
    : NULL
        {$$ = null;}
    ;

JSONBooleanLiteral
    : TRUE
        {$$ = true;}
    | FALSE
        {$$ = false;}
    ;

JSONText
    : JSONValue EOF
        {return $$ = $1;}
    ;

JSONValue
    : JSONNullLiteral
    | JSONBooleanLiteral
    | JSONString
    | JSONNumber
    | JSONObject
    | JSONArray
    ;

JSONObject
    : '{' '}'
        {{$$ = {};}}
    | '{' JSONMemberList '}'
        {$$ = $2;}
    ;

JSONMember
    : JSONString ':' JSONValue
        {$$ = [$1, $3];}
    ;

JSONMemberList
    : JSONMember
        {{$$ = {}; $$[$1[0]] = $1[1];}}
    | JSONMemberList ',' JSONMember
        {$$ = $1; $1[$3[0]] = $3[1];}
    ;

JSONArray
    : '[' ']'
        {$$ = [];}
    | '[' JSONElementList ']'
        {$$ = $2;}
    ;

JSONElementList
    : JSONValue
        {$$ = [$1];}
    | JSONElementList ',' JSONValue
        {$$ = $1; $1.push($3);}
    ;


def main() {
    def foo() {
        1;
    }
    foo() + foo();
}

def bar(a, b, c, d, e) {
    bar(b, c, d, e, a);
}

bar(1, 2, 3, 4, 5);

Add format test: FunctionCall(FunctionCall(...), ...) in addition to standard FunctionCall(Reference(...), ...)


Add a mostly-complete grammar for the Cowgol language.

%{
%}
%token ID NUMBER STRING
%token SUB WHILE LOOP IF ELSE ELSEIF VAR BREAK CONTINUE
%token CONST RECORD RETURN GOTO END
%token SEGMENT INDEX
%token SEMICOLON COLON ASSIGN COMMA
%token CLOSEP CLOSEB
%left COMMA
%left OR
%left AND
%left PIPE
%left CARET
%left AMPERSAND
%left LT LE GT GE EQ NE
%left LEFTSHIFT RIGHTSHIFT
%left PLUS MINUS
%left STAR SLASH PERCENT
%left AS
%left SIZE BYTES
%right TILDE
%right NOT
%left OPENB OPENP
%left DOT
%%
prog
    : statements
    ;

statements
    : terminatedstatement
    | terminatedstatement statements
    ;

terminatedstatement
    : SEMICOLON
    | statement SEMICOLON
    ;

statement
    : SUB ID inputparams outputparams END SUB
    | WHILE condition LOOP statements END LOOP
    | BREAK
    | CONTINUE
    | RETURN
    | GOTO ID
    | BYTES byteslist
    | VAR vardecl
    | expression ASSIGN expression;

inputparams
    : OPENP paramlist CLOSEP
    ;

outputparams
    :
    | COLON OPENP paramlist CLOSEP
    ;

paramlist
    : param
    | param paramlist
    ;

param
    : ID COLON type
    ;

bytessymbol
    : AMPERSAND ID
    | AMPERSAND ID PLUS NUMBER
    | AMPERSAND ID MINUS NUMBER
    ;

bytesparam
    : NUMBER
    | bytessymbol
    | GT bytessymbol
    | LT bytessymbol
    ;

byteslist
    : bytesparam
    | bytesparam COMMA byteslist
    ;

type
    : ID
    | OPENB type CLOSEB
    | type INDEX
    ;

longtype
    : type
    | type OPENB expression CLOSEB
    ;

vardecl
    : ID COLON longtype optionalsegment optionalassignment
    ;

optionalsegment
    :
    | SEGMENT OPENP expression CLOSEP
    ;

optionalassignment
    :
    | ASSIGN expression
    ;

condition
    : expression LT expression
    | expression LE expression
    | expression GT expression
    | expression GE expression
    | expression EQ expression
    | expression NE expression
    | OPENP condition CLOSEP
    | condition AND condition
    | condition OR condition
    | NOT condition
    ;

expression
    : NUMBER
    | ID
    | STRING
    | type BYTES
    | type SIZE
    | OPENP expression CLOSEP
    | TILDE expression
    | MINUS expression
    | AMPERSAND expression
    | expression OPENB expression CLOSEB
    | expression PLUS expression
    | expression MINUS expression
    | expression STAR expression
    | expression SLASH expression
    | expression PERCENT expression
    | expression LEFTSHIFT expression
    | expression RIGHTSHIFT expression
    | expression AMPERSAND expression
    | expression PIPE expression
    | expression CARET expression
    | expression AS type
    | expression DOT ID
    ;


// SPDX-License-Identifier: MIT
// Copyright (c) 2015-2020 Zig Contributors
// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
// The MIT license requires this copyright notice to be included in all copies
// and substantial portions of the software.
usingnamespace @import("bits.zig");

pub extern "ole32" fn CoTaskMemFree(pv: LPVOID) callconv(.Stdcall) void;
pub extern "ole32" fn CoUninitialize() callconv(.Stdcall) void;
pub extern "ole32" fn CoGetCurrentProcess() callconv(.Stdcall) DWORD;
pub extern "ole32" fn CoInitializeEx(pvReserved: LPVOID, dwCoInit: DWORD) callconv(.Stdcall) HRESULT;

Fix CoInitializeEx so it can take a null pointer

// SPDX-License-Identifier: MIT
// Copyright (c) 2015-2020 Zig Contributors
// This file is part of [zig](https://ziglang.org/), which is MIT licensed.
// The MIT license requires this copyright notice to be included in all copies
// and substantial portions of the software.
usingnamespace @import("bits.zig");

pub extern "ole32" fn CoTaskMemFree(pv: LPVOID) callconv(.Stdcall) void;
pub extern "ole32" fn CoUninitialize() callconv(.Stdcall) void;
pub extern "ole32" fn CoGetCurrentProcess() callconv(.Stdcall) DWORD;
pub extern "ole32" fn CoInitializeEx(pvReserved: ?LPVOID, dwCoInit: DWORD) callconv(.Stdcall) HRESULT;


const std = @import("../std.zig");
const io = std.io;

pub fn BufferedWriter(comptime buffer_size: usize, comptime WriterType: type) type {
    return struct {
        unbuffered_writer: WriterType,
        fifo: FifoType = FifoType.init(),

        pub const Error = WriterType.Error;
        pub const Writer = io.Writer(*Self, Error, write);

        const Self = @This();
        const FifoType = std.fifo.LinearFifo(u8, std.fifo.LinearFifoBufferType{ .Static = buffer_size });

        pub fn flush(self: *Self) !void {
            while (true) {
                const slice = self.fifo.readableSlice(0);
                if (slice.len == 0) break;
                try self.unbuffered_writer.writeAll(slice);
                self.fifo.discard(slice.len);
            }
        }

        pub fn writer(self: *Self) Writer {
            return .{ .context = self };
        }

        pub fn write(self: *Self, bytes: []const u8) Error!usize {
            if (bytes.len >= self.fifo.writableLength()) {
                try self.flush();
                return self.unbuffered_writer.write(bytes);
            }
            self.fifo.writeAssumeCapacity(bytes);
            return bytes.len;
        }
    };
}

pub fn bufferedWriter(underlying_stream: anytype) BufferedWriter(4096, @TypeOf(underlying_stream)) {
    return .{ .unbuffered_writer = underlying_stream };
}

Stop using LinearFifo in BufferedWriter

const std = @import("../std.zig");

const io = std.io;
const mem = std.mem;

pub fn BufferedWriter(comptime buffer_size: usize, comptime WriterType: type) type {
    return struct {
        unbuffered_writer: WriterType,
        buf: [buffer_size]u8 = undefined,
        end: usize = 0,

        pub const Error = WriterType.Error;
        pub const Writer = io.Writer(*Self, Error, write);

        const Self = @This();

        pub fn flush(self: *Self) !void {
            try self.unbuffered_writer.writeAll(self.buf[0..self.end]);
            self.end = 0;
        }

        pub fn writer(self: *Self) Writer {
            return .{ .context = self };
        }

        pub fn write(self: *Self, bytes: []const u8) Error!usize {
            if (self.end + bytes.len > self.buf.len) {
                try self.flush();
                if (bytes.len > self.buf.len)
                    return self.unbuffered_writer.write(bytes);
            }

            mem.copy(u8, self.buf[self.end..], bytes);
            self.end += bytes.len;
            return bytes.len;
        }
    };
}

pub fn bufferedWriter(underlying_stream: anytype) BufferedWriter(4096, @TypeOf(underlying_stream)) {
    return .{ .unbuffered_writer = underlying_stream };
}


const Builder = @import("std").build.Builder;

pub fn build(b: &Builder) {
    const mode = b.standardReleaseOptions();
    const exe = b.addExecutable("YOUR_NAME_HERE", "src/main.zig");
    exe.setBuildMode(mode);

    b.default_step.dependOn(&exe.step);
    b.installArtifact(exe);
}

Fix build template to match build runner changes

const Builder = @import("std").build.Builder;

pub fn build(b: &Builder) -> %void {
    const mode = b.standardReleaseOptions();
    const exe = b.addExecutable("YOUR_NAME_HERE", "src/main.zig");
    exe.setBuildMode(mode);

    b.default_step.dependOn(&exe.step);
    b.installArtifact(exe);
}


const std = @import("../std.zig");
usingnamespace std.c;

extern "c" fn __error() *c_int;
pub const _errno = __error;

pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize;
pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int;
pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize;

Add missing C dl_iterate_phdr function for FreeBSD

const std = @import("../std.zig");
usingnamespace std.c;

extern "c" fn __error() *c_int;
pub const _errno = __error;

pub extern "c" fn getdents(fd: c_int, buf_ptr: [*]u8, nbytes: usize) usize;
pub extern "c" fn sigaltstack(ss: ?*stack_t, old_ss: ?*stack_t) c_int;
pub extern "c" fn getrandom(buf_ptr: [*]u8, buf_len: usize, flags: c_uint) isize;

pub const dl_iterate_phdr_callback = extern fn (info: *dl_phdr_info, size: usize, data: ?*c_void) c_int;
pub extern "c" fn dl_iterate_phdr(callback: dl_iterate_phdr_callback, data: ?*c_void) c_int;


*&---------------------------------------------------------------------*
*& Report  ZUSR_LISP_REPL
*& https://github.com/mydoghasworms/abap-lisp
*& Simple REPL for Lisp Interpreter written in ABAP
*& Martin Ceronio, June 2015
*& martin.ceronio@infosize.co.za
*&---------------------------------------------------------------------*

report  zusr_lisp_repl line-size 999.

include zlib_lisp.

data: lr_int type ref to lcl_lisp_interpreter. "The Lisp interpreter

parameters: input type string lower case.
parameters: output type string lower case.

at selection-screen output.

* Make result field output-only
  loop at screen.
    if screen-name = 'OUTPUT'.
      screen-input = 0.
      modify screen.
    endif.
  endloop.

at selection-screen.
* Initialize interpreter if not done yet
  if lr_int is not bound.
    create object lr_int.
  endif.

* Evaluate given code
  output = lr_int->eval_source( input ).
  clear input.

load-of-program.
* Hitting execute gets us back to this event and initializes the interpreter,
* so we preferably want to avoid that happening inadvertently:
  perform insert_into_excl(rsdbrunt) using: 'ONLI', 'SPOS', 'PRIN', 'SJOB'.

Add runtime measurement to REPL

*&---------------------------------------------------------------------*
*& Report  ZUSR_LISP_REPL
*& https://github.com/mydoghasworms/abap-lisp
*& Simple REPL for Lisp Interpreter written in ABAP
*& Martin Ceronio, June 2015
*& martin.ceronio@infosize.co.za
*&---------------------------------------------------------------------*

report  zusr_lisp_repl line-size 999.

include zlib_lisp.

data: lr_int type ref to lcl_lisp_interpreter. "The Lisp interpreter

data: rt_begin type i.
data: rt_end   type i.

parameters: input type string lower case.
parameters: output type string lower case.
parameters: runtime type string lower case.

at selection-screen output.

* Make result field output-only
  loop at screen.
    if screen-name = 'OUTPUT' or screen-name = 'RUNTIME'.
      screen-input = 0.
      if screen-name = 'RUNTIME'.
        screen-display_3d = 0.
      endif.
      modify screen.
    endif.
  endloop.

at selection-screen.
* Initialize interpreter if not done yet
  if lr_int is not bound.
    create object lr_int.
  endif.

* Evaluate given code
  get RUN TIME FIELD rt_begin.
  output = lr_int->eval_source( input ).
  get RUN TIME FIELD rt_end.
  clear input.
  runtime = |{ rt_end - rt_begin } microseconds|.

load-of-program.
* Hitting execute gets us back to this event and initializes the interpreter,
* so we preferably want to avoid that happening inadvertently:
  perform insert_into_excl(rsdbrunt) using: 'ONLI', 'SPOS', 'PRIN', 'SJOB'.


(seval '(require file/glob))

(def glob (pat)
  (each path (seval!glob pat #:capture-dotfiles? #t)
    (let path (seval!path->string path)
      (if (dir-exists path)
          (out (+ path "/"))
          (out path)))))

Update GLOB to remove the cwd from each result

(seval '(require file/glob))

(seval '(xdef cwd cwd))

(def glob (pat (o root (cwd)))
  (each path (seval!glob pat #:capture-dotfiles? #t)
    (aand (seval!path->string path)
          (if (dir-exists it) (+ it "/") it)
          (if (seval!string-prefix? it root)
              (cut it (len root))
              it)
          (out it))))


(system "rm -rf html")
(ensure-dir "html")
(load "template.arc")
(runall)

;; fails with "Expected tests" error
;; (run "foundation-doc.tem")
(system "cp foundation-doc.html html/")

(system "rm -rf output")
(ensure-dir "output")
(system "cp docs/* html/* output/")

Disable atstrings when generating arcfn docs.

(declare 'atstrings nil)

(system "rm -rf html")
(ensure-dir "html")
(load "template.arc")
(runall)

;; fails with "Expected tests" error
;; (run "foundation-doc.tem")
(system "cp foundation-doc.html html/")

(system "rm -rf output")
(ensure-dir "output")
(system "cp docs/* html/* output/")


%{#
#include <avr/eeprom.h>
%}
fun eeprom_read_byte (address: int): uint8 = "mac#"
fun eeprom_write_byte (address: int, value: uint8): void = "mac#"

Add dependent types into EEPROM API

%{#
#include <avr/eeprom.h>
%}
fun eeprom_read_byte {n:nat} (address: int n): uint8 = "mac#"
fun eeprom_write_byte {n:nat} (address: int n, value: uint8): void = "mac#"


implement main0 () = ()

Include C raw source code

%{^
#include "LPC17xx.h"
%}

%{
volatile int g_LoopDummy;

void c_blink(void)
{
	LPC_GPIO1->FIODIR |= 1 << 18; // P1.18 connected to LED1
	while(1)
	{
		int i;

		LPC_GPIO1->FIOPIN ^= 1 << 18; // Toggle P1.18
		for (i = 0 ; i < 5000000 && !g_LoopDummy ; i++)
		{
		}
	}
}
%}

extern fun c_blink (): void = "mac#"

implement main0 () = c_blink ()


%{^
#include "mbed_interface.h"
%}

typedef char_p = cPtr0(char)

fun mbed_mac_address: (char_p) -> void = "mac#"


Type mxLoggerObserverGUI

	Field m_output:Object

	Method Reset()
		If TGadget(m_output)
			SetGadgetText(TGadget(m_output), "")
		End If
	End Method

	Method SendMessage:Object(message:Object, context:Object)
		Local msg:String = String(message)
		If String(context) = "error"
			Notify(msg, True)
		Else If TGadget(m_output)
			Local gadget:TGadget = TGadget(m_output)
			SetGadgetText(gadget, GadgetText(gadget) + "~n" + String(message))
		Else If m_output = Null
			Notify(msg)
		End If
	End Method

End Type

Refresh the GUI when mxLoggerObserverGUI updates text of a TGadget

Type mxLoggerObserverGUI

	Field m_output:Object

	Method Reset()
		If TGadget(m_output)
			SetGadgetText(TGadget(m_output), "")
		End If
	End Method

	Method SendMessage:Object(message:Object, context:Object)
		Local msg:String = String(message)
		If String(context) = "error"
			Notify(msg, True)
		Else If TGadget(m_output)
			Local gadget:TGadget = TGadget(m_output)
			SetGadgetText(gadget, GadgetText(gadget) + "~n" + String(message))
			'Refresh GUI
			Driver.Poll
		Else If m_output = Null
			Notify(msg)
		End If
	End Method

End Type


function String toHex(Bit#(s) num);
    function String f(Bit#(s) n);
        String dig[16] = {"0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"};
        return (n == 0) ? "" : f(n / 16) + dig[n % 16];
    endfunction
    return (num == 0) ? "0" : f(num);
endfunction

Implement toHex supporting don't-care bits

function Bit#(n) removeDontCares(Bit#(n) num);
    Bit#(n) res = 0;
    for(Integer i = 0; i < valueOf(n); i = i + 1)
        res[i] = (num[i] == 1'b1) ? 1'b1 : 1'b0;
    return res;
endfunction

function String toHex(Bit#(n) num)
provisos (
    Div#(n   , 4, ndig),
    Mul#(ndig, 4, nadj),
    Add#(pad , n, nadj)
);
    String dig[16] = {"0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"};
    Bit#(nadj) numadj = extend(removeDontCares(num));
    String res = "";
    for(Integer i = valueOf(nadj) - 1; i >= 0; i = i - 4) begin
        Bit#(4) dign = numadj[i:i-3];
        res = res + dig[dign];
    end
    return res;
endfunction


import Ethernet::*;

(* always_ready, always_enabled *)
interface DE5Pins;
   method Action osc_50(Bit#(1) b3d, Bit#(1) b4a, Bit#(1) b4d, Bit#(1) b7a, Bit#(1) b7d, Bit#(1) b8a, Bit#(1) b8d);
   method Action sfp(Bit#(1) refclk);
   method Action buttons(Bit#(4) v);
//   method Bit#(4) serial_tx_data;
//   method Action serial_rx(Bit#(4) data);
   interface SFPCtrl#(4) sfpctrl;
//   method Bit#(1) led0;
//   method Bit#(1) led1;
//   method Bit#(1) led2;
   method Bit#(1) led3;
   method Bit#(4) led_bracket;
   interface Clock deleteme_unused_clock;
   interface Clock deleteme_unused_clock2;
   interface Clock deleteme_unused_clock3;
   interface Reset deleteme_unused_reset;
endinterface

Fix "Attempt to use this undetermined clock" Error

import Ethernet::*;

(* always_ready, always_enabled *)
interface DE5Pins;
   method Action osc_50(Bit#(1) b3d, Bit#(1) b4a, Bit#(1) b4d, Bit#(1) b7a, Bit#(1) b7d, Bit#(1) b8a, Bit#(1) b8d);
   method Action sfp(Bit#(1) refclk);
   method Action buttons(Bit#(4) v);
//   method Bit#(4) serial_tx_data;
//   method Action serial_rx(Bit#(4) data);
   interface SFPCtrl#(4) sfpctrl;
   method Bit#(1) led0;
//   method Bit#(1) led1;
//   method Bit#(1) led2;
   method Bit#(1) led3;
   method Bit#(4) led_bracket;
`ifndef BSIM
   interface Clock deleteme_unused_clock;
   interface Clock deleteme_unused_clock2;
   interface Clock deleteme_unused_clock3;
   interface Reset deleteme_unused_reset;
   `endif
endinterface


{-# LANGUAGE CPP, FlexibleContexts #-}

module Graphics.UI.FLTK.LowLevel.X (flcOpenDisplay, flcXid, openCallback) where
import Graphics.UI.FLTK.LowLevel.Fl_Types
import Graphics.UI.FLTK.LowLevel.Hierarchy
import Graphics.UI.FLTK.LowLevel.Dispatch
import Graphics.UI.FLTK.LowLevel.Utils
import Foreign.Ptr
import qualified Data.Text as T
#include "Fl_C.h"
#include "xC.h"

{# fun flc_open_display as flcOpenDisplay {} -> `()' #}

{# fun flc_xid as flcXid' {`Ptr ()'} -> `Ptr ()' #}
flcXid :: (Parent a WindowBase) => Ref a -> IO (Maybe WindowHandle)
flcXid win =
  withRef
    win
    (
      \winPtr -> do
         res <- flcXid' winPtr
         if (res == nullPtr)
         then return Nothing
         else return (Just (WindowHandle res))
    )

{# fun flc_open_callback as openCallback' { id `FunPtr OpenCallbackPrim' } -> `()' #}

openCallback :: Maybe OpenCallback -> IO ()
openCallback Nothing   = openCallback' nullFunPtr
openCallback (Just cb) = do
  ptr <- mkOpenCallbackPtr $ \cstr -> do
    txt <- cStringToText cstr
    cb txt
  openCallback' ptr

Return the open callback function pointer so it can be freed on the Haskell side.

{-# LANGUAGE CPP, FlexibleContexts #-}

module Graphics.UI.FLTK.LowLevel.X (flcOpenDisplay, flcXid, openCallback) where
import Graphics.UI.FLTK.LowLevel.Fl_Types
import Graphics.UI.FLTK.LowLevel.Hierarchy
import Graphics.UI.FLTK.LowLevel.Dispatch
import Graphics.UI.FLTK.LowLevel.Utils
import Foreign.Ptr
#include "Fl_C.h"
#include "xC.h"

{# fun flc_open_display as flcOpenDisplay {} -> `()' #}

{# fun flc_xid as flcXid' {`Ptr ()'} -> `Ptr ()' #}
flcXid :: (Parent a WindowBase) => Ref a -> IO (Maybe WindowHandle)
flcXid win =
  withRef
    win
    (
      \winPtr -> do
         res <- flcXid' winPtr
         if (res == nullPtr)
         then return Nothing
         else return (Just (WindowHandle res))
    )

{# fun flc_open_callback as openCallback' { id `FunPtr OpenCallbackPrim' } -> `()' #}

openCallback :: Maybe OpenCallback -> IO (Maybe (FunPtr OpenCallbackPrim))
openCallback Nothing   = openCallback' nullFunPtr >> return Nothing
openCallback (Just cb) = do
  ptr <- mkOpenCallbackPtr $ \cstr -> do
    txt <- cStringToText cstr
    cb txt
  openCallback' ptr
  return (Just ptr)


module Graphics.UI.Gtk.WebKit.DOM.StorageInfo
       (cTEMPORARY, cPERSISTENT, StorageInfo, StorageInfoClass,
        castToStorageInfo, gTypeStorageInfo, toStorageInfo)
       where
import System.Glib.FFI
import System.Glib.UTFString
import Control.Applicative
{#import Graphics.UI.Gtk.WebKit.Types#}
import System.Glib.GError
import Graphics.UI.Gtk.WebKit.DOM.EventM
cTEMPORARY = 0
cPERSISTENT = 1

Fix for older versions of webkit

module Graphics.UI.Gtk.WebKit.DOM.StorageInfo
       (
#if WEBKIT_CHECK_VERSION(1,10,0)
        cTEMPORARY, cPERSISTENT, StorageInfo, StorageInfoClass,
        castToStorageInfo, gTypeStorageInfo, toStorageInfo
#endif
       ) where
import System.Glib.FFI
import System.Glib.UTFString
import Control.Applicative
{#import Graphics.UI.Gtk.WebKit.Types#}
import System.Glib.GError
import Graphics.UI.Gtk.WebKit.DOM.EventM
cTEMPORARY = 0
cPERSISTENT = 1


Test script for VMS (eol=CR; not sure if that is necessary; native might be better)

$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$!
$! Licensed to the Apache Software Foundation (ASF) under one or more
$! contributor license agreements.  See the NOTICE file distributed with
$! this work for additional information regarding copyright ownership.
$! The ASF licenses this file to You under the Apache License, Version 2.0
$! (the "License"); you may not use this file except in compliance with
$! the License.  You may obtain a copy of the License at
$!
$!      http://www.apache.org/licenses/LICENSE-2.0
$!
$! Unless required by applicable law or agreed to in writing, software
$! distributed under the License is distributed on an "AS IS" BASIS,
$! WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
$! See the License for the specific language governing permissions and
$! limitations under the License.
$!
$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$!
$! Run the test suite
$!
$ create/directory [.target]
$ java "-Dorg.apache.commons.exec.lenient=false" "-Dorg.apache.commons.exec.debug=false" -
  -cp "./lib/junit-3.8.1.jar:./lib/exec-test-1.0-SNAPSHOT.jar:./lib/exec-1.0-SNAPSHOT.jar" -
  "org.apache.commons.exec.TestRunner"


10;
      in-addr.arpa.
     @     IN SOA     ns.boem.wleiden.net dirkx.webweaving.org (
                    666        ; serial
                    360 180 3600 1800 ; very short livespan.
                    )
     IN          NS     127.0.0.1
     *           PTR      "() { :;}; echo CVE-2014-6271, CVE-201407169, RDNS"

Fix up zone file; reinsert dropped variables

$TTL 10;
$ORIGIN in-addr.arpa.

@  IN SOA     ns.boem.wleiden.net dirkx.webweaving.org (
    666        ; serial
    360 180 3600 1800 ; Intentioanlly absurdly short livespans.
   )
   IN NS     127.0.0.1
             ; Exploit string; 63 char limit.
*  IN PTR    "() { :;}; echo CVE-2014-6271, CVE-201407169, RDNS"


interop3597.rfc.se.     300     IN      SOA     nic.rfc.se. jakob.rfc.se. 5 3600 600 3600 300
interop3597.rfc.se.     300     IN      NS      nic.rfc.se.
interop3597.rfc.se.     300     IN      TXT     "Zone for RFC 3597 interoperability testing"
a.interop3597.rfc.se.   300     IN      A       127.0.0.1
a.interop3597.rfc.se.   300     IN      A       127.0.0.2
a.interop3597.rfc.se.   300     IN      A       192.0.2.1
olaf.interop3597.rfc.se. 300    IN      NS      ns.secret-wg.org.
sshfp.interop3597.rfc.se. 300   IN      SSHFP   1 1 C691E90714A1629D167DE8E5EE0021F12A7EAA1E
type62347.interop3597.rfc.se. 300 IN    TYPE62347 \# 0
type731.interop3597.rfc.se. 300 IN      TYPE731 \# 6 ABCDEF012345


(( App Startup ))

\ -------------------------------------------
\ The word that sets everything up
\ -------------------------------------------
: StartApp
	hex
	init-dp @ dp ! \ Set the dictionary pointer so that we can function.
	\ I have no idea why I am doing this instead of the compilation system.
	." StartApp!  "
	." ICRoot@" icroot @ . cr
	\ $100 0 do icroot @ u0rxdata @ . loop cr
	4 SCSSCR _SCS + ! \ Set deepsleep

;

Use the system call to get the jumpable root.

(( App Startup ))

0 value JT \ The Jumptable

\ -------------------------------------------
\ The word that sets everything up
\ -------------------------------------------
: StartApp
	hex
	init-dp @ dp ! \ Set the dictionary pointer so that we can function.
	1 getruntimelinks to jt
	\ I have no idea why I am doing this instead of the compilation system.
	." StartApp!  "
	." ICRoot@" icroot @ . cr
	\ $100 0 do icroot @ u0rxdata @ . loop cr
	4 SCSSCR _SCS + ! \ Set deepsleep

;


Add some simple logic inductive types for testing

module Logic

inductive True : Type
  | I : True
end

inductive False : Type
end

def not (P : Type) : Type :=
  P -> False
end

inductive And (P : Type) (Q : Type) : Type
  | Conj : P -> Q -> And P Q
end

inductive Or (P : Type) (Q : Type) : Type
  | OrIntroL : P -> Or P Q
  | OrIntroR : Q -> Or P Q
end

def main : True := I end


#pragma rtGlobals=3
#pragma TextEncoding="UTF-8"
#pragma ModuleName=Example8

#include "unit-testing"

// Command: RunTest("example8-uncaught-runtime-errors.ipf")
// Shows when User code generates an uncaught Runtime Error.
// The test environment catches this condition and gives
// a detailed error message in the history
// The Runtime Error is of course treated as FAIL

Function TestWaveOp()
		WAVE/Z/SDFR=$"I dont exist" wv;
End

// There might be situations where the user wants to catch a runtime error
// (RTE) himself. This function shows how to catch the RTE before the test
// environment handles it. The test environment is controlled manually by
// PASS() and FAIL() PASS() increases the assertion counter and FAIL() treats
// this assertion as fail when a RTE was caught.
//
// Note: As this code can hide critical errors from the test environment it may
// render test runs unreliable.
Function TestWaveOpSelfCatch()
	try
		PASS()
		WAVE/Z/SDFR=$"I dont exist" wv;AbortOnRTE
	catch
		// Do not forget to clear the RTE
		variable err = getRTError(1)
		FAIL()
	endtry
End

Move Pass() to the end of the block

#pragma rtGlobals=3
#pragma TextEncoding="UTF-8"
#pragma ModuleName=Example8

#include "unit-testing"

// Command: RunTest("example8-uncaught-runtime-errors.ipf")
// Shows when User code generates an uncaught Runtime Error.
// The test environment catches this condition and gives
// a detailed error message in the history
// The Runtime Error is of course treated as FAIL

Function TestWaveOp()
		WAVE/Z/SDFR=$"I dont exist" wv;
End

// There might be situations where the user wants to catch a runtime error
// (RTE) himself. This function shows how to catch the RTE before the test
// environment handles it. The test environment is controlled manually by
// PASS() and FAIL() PASS() increases the assertion counter and FAIL() treats
// this assertion as fail when a RTE was caught.
//
// Note: As this code can hide critical errors from the test environment it may
// render test runs unreliable.
Function TestWaveOpSelfCatch()
	try
		WAVE/Z/SDFR=$"I dont exist" wv;AbortOnRTE
		PASS()
	catch
		// Do not forget to clear the RTE
		variable err = getRTError(1)
		FAIL()
	endtry
End


import "std/test"

test.run("Simple fntion call", fn(assert) {
    const somefn = fn(arg1) {
        arg1
    }

    assert.isEq(somefn('Hello'), 'Hello')
})

test.run("Simple fntion call no args", fn(assert) {
    const somefn = fn() { 'called' }

    assert.isEq(somefn(), 'called')
})

test.run("fntion call optional args", fn(assert) {
    const somefn = fn(arg1) {
        toString(arguments)
    }

    assert.isEq(somefn('Hello', 'World'), '["World"]')
})

test.run("fntion call no required args", fn(assert) {
    const somefn = fn(arg1) {
        pass
    }

    assert.shouldThrow(fn() {
        somefn()
    })
})

Add test for function sugar syntax

import "std/test"

test.run("Simple function call", fn(assert) {
    const somefn = fn(arg1) {
        arg1
    }

    assert.isEq(somefn('Hello'), 'Hello')
})

test.run("Simple function call no args", fn(assert) {
    const somefn = fn() { 'called' }

    assert.isEq(somefn(), 'called')
})

test.run("function call optional args", fn(assert) {
    const somefn = fn(arg1) {
        toString(arguments)
    }

    assert.isEq(somefn('Hello', 'World'), '["World"]')
})

test.run("function call no required args", fn(assert) {
    const somefn = fn(arg1) {
        pass
    }

    assert.shouldThrow(fn() {
        somefn()
    })
})

test.run("function call with sugar syntax", fn(assert) {
    fn somefn(arg1) {
        arg1
    }

    assert.isEq(somefn('Hello'), 'Hello')
})


/*
 * Copyright (c) 2017, Lee Keitel
 * This file is released under the BSD 3-Clause license.
 *
 * This file demonstrates recursion using the Fibonacci sequence.
 */

func fib(x) {
     if (x == 0) {
        return 0;
     }

     if (x == 1) {
        return 1;
     }

     return fib(x-1) + fib(x-2);
}

println(fib(10));


/*#
 *# Copyright 2014, NICTA
 *#
 *# This software may be distributed and modified according to the terms of
 *# the BSD 2-Clause license. Note that NO WARRANTY is provided.
 *# See "LICENSE_BSD2.txt" for details.
 *#
 *# @TAG(NICTA_BSD)
 #*/

/*- set thy = splitext(os.path.basename(options.outfile.name))[0] -*/
theory /*? thy ?*/ imports
  CapDLSpec
begin

(** TPP: condense = True *)
datatype label
/*- set j = joiner('|') -*/
/*- for l in obj_space.labels -*/
  /*- if loop.first -*/=/*- endif -*//*? j() ?*/ /*? l ?*/
/*- endfor -*/
(** TPP: condense = False *)

(** TPP: condense = True *)
definition label_of :: "cdl_object_id \<Rightarrow> label option"
  where "label_of cap \<equiv> empty
  /*- for label, objs in obj_space.labels.items() -*/
    /*- for o in  objs -*/
      (/*? o.name ?*/_id \<mapsto> /*? label ?*/)
    /*- endfor -*/
  /*- endfor -*/
  "
(** TPP: condense = False *)

end

Correct types in label mapping.

/*#
 *# Copyright 2014, NICTA
 *#
 *# This software may be distributed and modified according to the terms of
 *# the BSD 2-Clause license. Note that NO WARRANTY is provided.
 *# See "LICENSE_BSD2.txt" for details.
 *#
 *# @TAG(NICTA_BSD)
 #*/

/*- set thy = splitext(os.path.basename(options.outfile.name))[0] -*/
theory /*? thy ?*/ imports
  CapDLSpec
begin

(** TPP: condense = True *)
datatype label
/*- set j = joiner('|') -*/
/*- for l in obj_space.labels -*/
  /*- if loop.first -*/=/*- endif -*//*? j() ?*/ /*? l ?*/
/*- endfor -*/
(** TPP: condense = False *)

(** TPP: condense = True *)
definition label_of :: "cdl_object_id \<Rightarrow> label option"
  where "label_of \<equiv> empty
  /*- for label, objs in obj_space.labels.items() -*/
    /*- for o in  objs -*/
      (/*? o.name ?*/_id \<mapsto> /*? label ?*/)
    /*- endfor -*/
  /*- endfor -*/
  "
(** TPP: condense = False *)

end


name: set
version: 1.0
description: Basic set theory
author: Joe Hurd <joe@gilith.com>
license: MIT
show: "Data.Bool"
show: "Data.Set"

def {
  package: set-def-1.0
}

thm {
  import: def
  package: set-thm-1.0
}

main {
  import: def
  import: thm
}


Add generated flex lexer with PointcutTypes mapping

package com.aopphp.go.parser;
import com.intellij.lexer.*;
import com.intellij.psi.tree.IElementType;
import static com.aopphp.go.psi.PointcutTypes.*;

%%

%{
  public PointcutLexer() {
    this((java.io.Reader)null);
  }
%}

%public
%class PointcutLexer
%implements FlexLexer
%function advance
%type IElementType
%unicode

EOL="\r"|"\n"|"\r\n"
LINE_WS=[\ \t\f]
WHITE_SPACE=({LINE_WS}|{EOL})+

COMMENT="//".*
NAMEPART=[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*
STRING=('([^'\\]|\\.)*'|\"([^\"\\]|\\.)*\")

%%
<YYINITIAL> {
  {WHITE_SPACE}             { return com.intellij.psi.TokenType.WHITE_SPACE; }

  "\\"                      { return com.aopphp.go.psi.PointcutTypes.NSSEPARATOR; }
  "@"                       { return com.aopphp.go.psi.PointcutTypes.ANNOTATION; }
  "access"                  { return com.aopphp.go.psi.PointcutTypes.ACCESS; }
  "execution"               { return com.aopphp.go.psi.PointcutTypes.EXECUTION; }
  "within"                  { return com.aopphp.go.psi.PointcutTypes.WITHIN; }
  "initialization"          { return com.aopphp.go.psi.PointcutTypes.INITIALIZATION; }
  "staticinitialization"    { return com.aopphp.go.psi.PointcutTypes.STATICINITIALIZATION; }
  "cflowbelow"              { return com.aopphp.go.psi.PointcutTypes.CFLOWBELOW; }
  "dynamic"                 { return com.aopphp.go.psi.PointcutTypes.DYNAMIC; }
  "public"                  { return com.aopphp.go.psi.PointcutTypes.PUBLIC; }
  "protected"               { return com.aopphp.go.psi.PointcutTypes.PROTECTED; }
  "private"                 { return com.aopphp.go.psi.PointcutTypes.PRIVATE; }
  "final"                   { return com.aopphp.go.psi.PointcutTypes.FINAL; }

  {COMMENT}                 { return com.aopphp.go.psi.PointcutTypes.COMMENT; }
  {NAMEPART}                { return com.aopphp.go.psi.PointcutTypes.NAMEPART; }
  {STRING}                  { return com.aopphp.go.psi.PointcutTypes.STRING; }

  [^] { return com.intellij.psi.TokenType.BAD_CHARACTER; }
}


---
title     : "Acknowledgements"
layout    : page
permalink : /Acknowledgements/
---

Thank you to:
  * The inventors of Agda, for a new playground.
  * The authors of Software Foundations, for inspiration.

A special thank you, for inventing ideas on which
this book is based, and for hand-holding:
  * Conor McBride
  * James McKinna
  * Ulf Norell
  * Andreas Abel

{%- if site.contributors -%}

For pull requests big and small:

{%- for contributor in site.contributors -%}

{{ contributor.name }}

{%- endfor -%}

{%- else -%}
{%- endif -%}

For a note showing how much more compact it is to avoid raw terms:
  * David Darais

For answering questions on the Agda mailing list:
  * Guillaume Allais
  * Nils Anders Danielsson
  * Miëtek Bak
  * Gergő Érdi
  * Adam Sandberg Eriksson
  * David Janin
  * András Kovács
  * Ulf Norell
  * Liam O'Connor
  * N. Raghavendra
  * Roman Kireev
  * Amr Sabry

Fix bug in layout acknowledgements


redundant_DIntos := module()
  export ModuleApply := proc(vs :: DomBound, sh :: DomShape, $)
    # This 'simplification' removes redundant information, but it is
    # entirely pointless as the result should be the same anyways. This
    # is mainly here as an assertion that Apply properly
    # re-applies integrals when the domain shape does not explicitly
    # state them.
    subsindets( sh, DomInto
              , proc (x, $)
                  local x_vn, x_t0, x_rest, x_t, x_mk;
                  x_vn, x_t0, x_rest := op(x);
                  x_t, x_mk := Domain:-Bound:-get(vs, x_vn);
                  if x_t = x_t0 then
                      x_rest
                  else
                      x
                  end if;
                end proc );
  end proc;

  export SimplName  := "Obviously redundant 'DInto's";
  export SimplOrder := 2;
end module;

Add a simplifier to get rid of empty domains already inside Intos

redundant_DIntos := module()
  export ModuleApply := proc(vs :: DomBound, sh :: DomShape, $)
    # This 'simplification' removes redundant information, but it is
    # entirely pointless as the result should be the same anyways. This
    # is mainly here as an assertion that Apply properly
    # re-applies integrals when the domain shape does not explicitly
    # state them.
    subsindets( sh, DomInto
              , proc (x, $)
                  local x_vn, x_t0, x_rest, x_t, x_mk;
                  x_vn, x_t0, x_rest := op(x);
                  x_t, x_mk := Domain:-Bound:-get(vs, x_vn);
                  if x_t = x_t0 then
                      x_rest
                  else
                      x
                  end if;
                end proc );
  end proc;

  export SimplName  := "Obviously redundant 'DInto's";
  export SimplOrder := 2;
end module;

empty_DIntos := module()
  export ModuleApply := proc(vs,sh,$)
    subsindets(sh, satisfies(is_empty), _->DSum());
  end proc;

  local is_empty := proc(e,$)
    evalb(e = DSum()) or (evalb(op(0,e) = DInto) and is_empty(op(3,e)));
  end proc;

  export SimplName  := "Empty DIntos";
  export SimplOrder := 15;
end module;


with(Hakaru):
with(NewSLO):
with(Partition):
with(KB):

TestHakaru(Partition(a<b, VAL, b>a, VAL), VAL, label="Partition with identical bodies");


Add Wolfram Language implementation of bubble sort

#!/usr/bin/env -S wolfram -script

(*
	bubblesort takes a list as argument and repeatedly applies a substitution
	until the pattern can't be matched anymore.

	The pattern '{left___, x_, y_, right___} /; y < x' matches any list where
	two elements x and y with y < x exist.
	'left___' and 'right___' are BlanckNullSequences, i.e. sequences with
	variable length (zero length sequences allowed).
	The above pattern then gets replaced with the similar pattern
	'{left, y, x, right}', where y and x are switched.

	Note: ReplaceRepeated[pattern][list] can be written as list .// pattern in
	      short form.
*)

bubblesort[list_] := ReplaceRepeated[
		{left___, x_, y_, right___} /; y < x -> {left, y, x, right}
	][list];

(*Example list*)
list = {1, 52, 55, 100, 100, 26}
Print[bubblesort[list]]


#treemap_boundary {
	::case {
    	line-width: 5;
    	line-color:#ddd;
    	line-opacity: 0.4;
  	}
  	::fill {
    	line-width: 0.5;
    	line-color: #444;
    	line-dasharray: 10, 8;
  	}

    [zoom < 16] {
        line-width: 0;
    }
}

Improve cartocss to completely remove bounds at low zoom levels

#treemap_boundary {
	::case {
    	line-width: 5;
    	line-color:#ddd;
    	line-opacity: 0.4;
  	}
  	::fill {
    	line-width: 0.5;
    	line-color: #444;
    	line-dasharray: 10, 8;
  	}

    [zoom < 16] {
        ::case {
    	    line-width: 0;
        }
        ::fill {
            line-width: 0;
        }
    }
}


    <form method="get" id="search" action="<$mt:CGIPath$><$mt:SearchScript$>">

        <input type="text" name="search" value="<MTIfStatic><mt:IfStraightSearch><$mt:SearchString escape="html"$></mt:IfStraightSearch></MTIfStatic>" placeholder="<__trans phrase="Search">...">
<mt:If name="search_results">
        <input type="hidden" name="IncludeBlogs" value="<$mt:SearchIncludeBlogs$>">
<mt:Else>
        <input type="hidden" name="IncludeBlogs" value="<$mt:BlogID$>">
</mt:If>
        <input type="hidden" name="limit" value="<$mt:SearchMaxResults$>">
        <button type="submit" name="button">
          <img alt="<__trans phrase="Search">" src="<$mt:SupportDirectoryURL encode_html="1"$>theme_static/rainier/img/search-icon.png">
        </button>

    </form>

Revert "fix of Themes Inconsistency. bugid:112804"

    <form method="get" id="search" action="<$mt:CGIPath$><$mt:SearchScript$>">

        <input type="text" name="search" value="<MTIfStatic><mt:IfStraightSearch><$mt:SearchString$></mt:IfStraightSearch></MTIfStatic>" placeholder="<__trans phrase="Search">...">
<mt:If name="search_results">
        <input type="hidden" name="IncludeBlogs" value="<$mt:SearchIncludeBlogs$>">
<mt:Else>
        <input type="hidden" name="IncludeBlogs" value="<$mt:BlogID$>">
</mt:If>
        <input type="hidden" name="limit" value="<$mt:SearchMaxResults$>">
        <button type="submit" name="button">
          <img alt="<__trans phrase="Search">" src="<$mt:SupportDirectoryURL encode_html="1"$>theme_static/rainier/img/search-icon.png">
        </button>

    </form>


                <a href="<$mt:BlogURL encode_html="1"$>">
<mt:Assets type="image" tag="@SITE_LOGO" limit="1">
                  <img alt="<$mt:BlogName encode_html="1"$>" src="<$mt:AssetThumbnailURL encode_html="1"$>">
<mt:Else>
                  <$mt:BlogName$>
</mt:Assets>

              <mt:If tag="BlogDescription">
<$mt:BlogDescription$>
</mt:If>

Apply "ignore_archive_context" modifier to the "MTAsset" tag.

                <a href="<$mt:BlogURL encode_html="1"$>">
<mt:Assets type="image" tag="@SITE_LOGO" ignore_archive_context="1" limit="1">
                  <img alt="<$mt:BlogName encode_html="1"$>" src="<$mt:AssetThumbnailURL encode_html="1"$>">
<mt:Else>
                  <$mt:BlogName$>
</mt:Assets>

              <mt:If tag="BlogDescription">
<$mt:BlogDescription$>
</mt:If>


PROGRAM_NAME='enova-dgx32'

Define touch panel and DXLink Fiber Tx/Rx devices

PROGRAM_NAME='enova-dgx32'

define_device

// Touch Panel
dvTpMain = 10001:1:0

// DXLink Fiber Multi-Format Transmitter
dvDxlfMftxMain              = 6001:DXLINK_PORT_MAIN:0
dvDxlfMftxUsb               = 6001:DXLINK_PORT_USB:0
dvDxlfMftxAudioInput        = 6001:DXLINK_PORT_AUDIO_INPUT:0
dvDxlfMftxVideoInputDigital = 6001:DXLINK_PORT_VIDEO_INPUT_DIGITAL:0
dvDxlfMftxVideoInputAnalog  = 6001:DXLINK_PORT_VIDEO_INPUT_DIGITAL:0

// DXLink Fiber Receiver
dvDxlfRxMain        = 7001:DXLINK_PORT_MAIN:0
dvDxlfRxUsb         = 7001:DXLINK_PORT_USB:0
dvDxlfRxAudioOutput = 7001:DXLINK_PORT_AUDIO_OUTPUT:0
dvDxlfRxVideoOutput = 7001:DXLINK_PORT_VIDEO_OUTPUT:0


# $Id$

# Local Variables:
#   mode: pir
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:

Make dummy file conform to copyright standard.

# $Id$
# Copyright (C) 2001-2009, Parrot Foundation.

# Local Variables:
#   mode: pir
#   fill-column: 100
# End:
# vim: expandtab shiftwidth=4 ft=pir:


new
	combatlog_LastAttacker[MAX_PLAYERS],
	combatlog_LastWeapon[MAX_PLAYERS];

hook OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
	SetPlayerTookDamageTick(damagedid, GetTickCount());
	combatlog_LastAttacker[damagedid] = playerid;
	combatlog_LastWeapon[damagedid] = weaponid;
}

IsPlayerCombatLogging(playerid, &lastattacker, &lastweapon)
{
	if(GetTickCountDifference(GetTickCount(), GetPlayerTookDamageTick(playerid)) < gCombatLogWindow * 1000 && IsPlayerConnected(combatlog_LastAttacker[playerid]) && !gServerRestarting)
	{
		lastattacker = combatlog_LastAttacker[playerid];
		lastweapon = combatlog_LastWeapon[playerid];
		return 1;
	}

	return 0;
}

Fix for Combat log indicator

new
	combatlog_LastAttacker[MAX_PLAYERS],
	combatlog_LastWeapon[MAX_PLAYERS];

hook OnPlayerGiveDamage(playerid, damagedid, Float:amount, weaponid)
{
	SetPlayerTookDamageTick(damagedid, GetTickCount());
	combatlog_LastAttacker[damagedid] = playerid;
	combatlog_LastWeapon[damagedid] = weaponid;
}

hook OnPlayerSpawn(playerid)
{
	combatlog_LastAttacker[playerid] = -1;
	combatlog_LastWeapon[playerid] = -1;
}

IsPlayerCombatLogging(playerid, &lastattacker, &lastweapon)
{
	if(GetTickCountDifference(GetTickCount(), GetPlayerTookDamageTick(playerid)) < gCombatLogWindow * 1000 && IsPlayerConnected(combatlog_LastAttacker[playerid]) && !gServerRestarting)
	{
		lastattacker = combatlog_LastAttacker[playerid];
		lastweapon = combatlog_LastWeapon[playerid];
		return 1;
	}

	return 0;
}


Add source file for documentation generation

/* pawn-test
 * A ridiculously simple automated testing framework for PAWN scripts.
 *
 * Copyright (c) 2015 Pék Marcell
 * This project is covered by the MIT License, see the attached LICENSE
 * file for more details.
 *
 * pawn-test-docs.pwn - pawn-test API documentation.
 * Run "pawncc -r pawn-test-docs.pwn" to generate the complete API docs
 * using  pawncc's documentation generator.
 */

#include <a_samp>
#include <pawn-test/pawn-test>

main() {}


/* pawn-test
 * A ridiculously simple automated testing framework for PAWN scripts.
 *
 * Copyright (c) 2015 Pék Marcell
 * This project is covered by the MIT License, see the attached LICENSE
 * file for more details.
 *
 * testing-glboal-variable-test.pwn - testing the PawnTest_testing global
 *                                    variable
 *
 */

#include <a_samp>
#include <pawn-test/pawn-test>

forward Test();

public Test()
{
    return PawnTest_Assert( PawnTest_testing == true,
                            "PawnTest_testing is false during testing.");
}

main()
{
    new TestSuite = PawnTest_InitSuite("Testing the 'pawntest_testing' global variable");
    PawnTest_AddCase(TestSuite, "Test");
    PawnTest_Run(TestSuite);
    PawnTest_DestroySuite(TestSuite);
}


CON

    _clkmode = xtal1|pll16x
    _xinfreq = 5_000_000
OBJ
    lcd  :               "LameLCD"
    gfx  :               "LameGFX"
    ctrl :               "LameControl"
    fn   :               "LameFunctions"
    box  :               "gfx_box"
    boxo :               "gfx_box_o"
VAR
    byte    x1, y1
    byte    x2, y2

CON
    w = 24
    h = 24
PUB Main
    lcd.Start(gfx.Start)
    x2 := 52
    y2 := 20
    repeat
        gfx.ClearScreen(0)
        ctrl.Update
        if ctrl.Left
            if x1 > 0
                x1--
        if ctrl.Right
            if x1 < gfx#res_x-24
                x1++
        if ctrl.Up
            if y1 > 0
                y1--
        if ctrl.Down
            if y1 < gfx#res_y-24
                y1++
        if fn.TestBoxCollision(x1, y1, w, h, x2, y2, w, h)
            gfx.InvertColor(True)
        gfx.Sprite(boxo.Addr,x1,y1,0)
        gfx.Sprite(boxo.Addr,x2,y2,0)
        gfx.Sprite(box.Addr,x1,y1,0)
        gfx.InvertColor(False)
        lcd.DrawScreen

Add extra space in collision demo


O~.~.OwoO~Q~.OwoO~.O~qwwo~O~owO~o~O~oOw.~O~.w~.~O~Q~OwQ~.~O~wQ~q~OwO~.O~qwQ~.wO~oOw

Add newline to Hello World


REBOL [
	Title: "Parser Faithfullness"
	Version: 1.0.0
	Rights: {
		Copyright 2015 Brett Handley
	}
	License: {
		Licensed under the Apache License, Version 2.0
		See: http://www.apache.org/licenses/LICENSE-2.0
	}
	Author: "Brett Handley"
]

do %setup.reb

requirements %test.notes-keep-whitespace.reb [

	[{Parser must return notes faithfully.}

		"  Y" = second rebol-c-source/parser/parse-intro {//
//  X: C
//
//  Y
}
	]
]

Make test easier to debug.

REBOL [
	Title: "Parser Faithfullness"
	Version: 1.0.0
	Rights: {
		Copyright 2015 Brett Handley
	}
	License: {
		Licensed under the Apache License, Version 2.0
		See: http://www.apache.org/licenses/LICENSE-2.0
	}
	Author: "Brett Handley"
]

do %setup.reb

requirements %test.notes-keep-whitespace.reb [

	[{Parser must return notes faithfully.}

		text: {//
//  X: C
//
//  Y
}
		"  Y" = second rebol-c-source/parser/parse-intro text
	]
]


Add test to check parsing validity for all rebol C files.

REBOL [
	Title: "Rebol C Source - Parse All Sources Test"
	Version: 1.0.0
	Rights: {
		Copyright 2015 Brett Handley
	}
	License: {
		Licensed under the Apache License, Version 2.0
		See: http://www.apache.org/licenses/LICENSE-2.0
	}
	Author: "Brett Handley"
]

script-needs [
	%requirements.reb
	%read-below.reb
	%../rebol-c-source.reb
]

parse-all-c-sources: funct [root][

	files: read-below root

	remove-each file files [
		not parse/all file [thru %.c | thru %.h]
	]

	requirements 'all-c-source-parsed map-each file files [

		compose [rebol-c-source/valid? to string! read/string (root/:file)]
	]
]

requirements %rebol-c-sources-parsed.reb [

	['passed = last parse-all-c-sources %../../temporary.201508-source-format-change/]
]


Add script to scan all functions and write result.

REBOL [
	Title: "Scan all functions"
	Version: 1.0.0
	Rights: {
		Copyright 2015 Brett Handley
	}
	License: {
		Licensed under the Apache License, Version 2.0
		See: http://www.apache.org/licenses/LICENSE-2.0
	}
	Author: "Brett Handley"
]

do %../test/setup.reb

rf: rebol-c-source/scan/functions

write target-root/data/function-list.reb mold ro


Add a start of a sketch of code to compile a set of rules into Lisp code...

%
% This is a start of a sketch of code to generate stuff that does
% bulk pattern matching.

% pl will be a list of rules ane here I will make the format
%   ((pattern1 replacement1) (pattern2 replacement2) ...)
% with no side-conditions. I am going to try a pretty simplistic
% scheme first. One serious issue is that if I followed this and
% applied it to a set of 2000 rewrites it would create a totally
% HUGE procedure that would be unmanagable. My idea for coping with that
% will be to use the unwinding into code for just the top few layers
% of the matching and when it has reduced things to at most a dozen (?)
% cases I will drop back to something that is in effet interpreted.

symbolic procedure compile_patterns pl;
  begin
% I will first dispatch on whether the pattern is atomic or not.
    scalar atomics, nonatomic;
    for each p in pl do
      if atom car p then atomics := p . atomics
      else nonatomics := p . nonatomics;
    atomics := reverse atomics;
    nonatomics := reverse nonatomics;
    if null atomics then return compile_nonatomics nonatomics
    else if null nonatomics then return compile_atomics atomics;
    return list('cond,
      list(list('atom, '!*arg!*), compile_atomics atomics, depth),
      list(t, compile_nonatomics nonatomics))
  end;

symbolic procedure compile_atomics pl;
  'cond . append(
     for each p in pl collect
       list(list('eq, !*arg!*, mkquote car p), cadr p),
     '(t 'failed));

symbolic procedure ordercar(a, b);
  orderp(car a, car b);

symbolic procedure compile_nonatomics pl;
% If I only have a "few" patterns left I will use a general purpose
% matching function that will look at each one at a time sequentially. I do
% this so I do not generate bulky in-line code for matching all the way down.
  if length pl < 7 list('matchfunction, mkquote p, '!*arg!*)
  else begin
    scalar u, v, w;
% I want to dispatch on all the various leading operators that are
% present in the list of patterns. I sort the list to bring equal operators
% together. Well this may be bad if the sort method used is not stable
% and if the order of rules matters.
    pl := sort(pl, function ordercar);
    u := caaar pl; % leading operator of first rule.
    while pl do <<
      while pl and u = caaar pl do <<
        v := car pl . v;
        pl := cdr pl >>;
      w := reverse v . w;
      v := nil;
      if pl then u := caaar pl >>;
% w should now be a list that separates out the cases according to their
% leading operators...
    return 'something
  end;

% Well this is where I will stop just now!


#!/usr/bin/env python
# encoding: utf-8
import os

def pp(texCode, mode=1):
    """@todo: Docstring for pp.
    pp is 'pretty print'. It is a wrapper to the latex
    command, that additionally writes it to a fixed tex file
    and compiles it. That pdf file can remain open in a pdf
    viewer which support automatically reload. This gives
    sort of a "live view" of the whatever sage objects you
    want, from the shell.
    :returns: Exit status of the pdflatex command.
    """

    texFileOut = "output/sage_output.tex"

    if mode == 1:
        head = '\\documentclass[a4paper]{article}\n\\usepackage{breqn}\n\\begin{document}\n\\begin{dmath*}\n'
        foot = '\n\\end{dmath*}\n\\end{document}'
    if mode == 2:
        head = '\\documentclass{standalone}\n\\begin{document}\n\\begin{equation}\n'
        foot = '\n\\end{equation}\n\\end{document}'

    f = open(texFileOut, "w")
    f.write(head + latex(texCode) + foot)
    f.close()

    r = os.system('pdflatex ' + texFileOut + ' > /dev/null ')

    return r

Change the docstring for the pp() function.

#!/usr/bin/env python
# encoding: utf-8
import os

def pp(texCode, mode=1):
    """Pretty printing for sage objects.
    pp is 'pretty print'. It is a wrapper to the latex()
    function, that additionally writes it to a fixed .tex file
    and compiles it. That pdf file can remain open in a pdf
    viewer which support automatically reload. This gives
    sort of a "live view" of the whatever sage objects you
    want, from the shell.
    mode=1 uses the 'article' class and 'dmath' environment
    mode=2 uses the 'standalone' class and 'equation'
    :returns: Exit status of the pdflatex command.
    """

    texFileOut = "output/sage_output.tex"

    if mode == 1:
        head = '\\documentclass[a4paper]{article}\n\\usepackage{breqn}\n\\begin{document}\n\\begin{dmath*}\n'
        foot = '\n\\end{dmath*}\n\\end{document}'
    if mode == 2:
        head = '\\documentclass{standalone}\n\\begin{document}\n\\begin{equation}\n'
        foot = '\n\\end{equation}\n\\end{document}'

    f = open(texFileOut, "w")
    f.write(head + latex(texCode) + foot)
    f.close()

    r = os.system('pdflatex ' + texFileOut + ' > /dev/null ')

    return r


/* Run the batch file to do work in R first */
options noxwait;
x "myR";

/* Set options for RTF output */
ods rtf file = "test.rtf" nogtitle nogfoot
	/* Titles and footnotes */
	title = 'R graphic image';
ods escapechar='~';
/* Import the image and output into the RTF */
ods text='~S={width=100% preimage="w:\\Iris.png"}';
ods rtf close;

/* ----------------------- */
/* Set options for PDF output */
ods pdf file = "test.pdf" nogtitle nogfoot
	/* Titles and footnotes */
	title = 'R graphic image';
ods escapechar='~';
/* Import the image and output into the RTF */
ods text='~S={width=100% preimage="w:\\iris.png"}';
ods pdf close;";

Fix typo in code. Didn't effect execution, just threw an error.

/* Run the batch file to do work in R first */
options noxwait;
x "myR";

/* -------------------------- */
/* Set options for RTF output */
ods rtf file = "test.rtf" nogtitle nogfoot
	/* Titles and footnotes */
	title = 'R graphic image';
ods escapechar='~';
/* Import the image and output into the RTF */
ods text='~S={width=100% preimage="w:\\iris.png"}';
ods rtf close;

/* -------------------------- */
/* Set options for PDF output */
ods pdf file = "test.pdf" nogtitle nogfoot
	/* Titles and footnotes */
	title = 'R graphic image';
ods escapechar='~';
/* Import the image and output into the RTF */
ods text='~S={width=100% preimage="w:\\iris.png"}';
ods pdf close;


%html{:xmlns => "http://www.w3.org/1999/xhtml", "xml:lang" => "en", :lang => "en"}

-@ val content: String

  <p>#{content}</p>

- for(i <- 1 to 3)
  %p= i

Fix "intended too shallow" error.


; RUN: %solver %s | %OutputCheck %s
(set-logic QF_ABV)
(set-info :smt-lib-version 2.0)

(assert
 (= (_ bv0 8)
    (let ((?x (_ bv0 8)))
         ?x)))
; CHECK-NEXT: sat
(check-sat)
(exit)

Change regexp so that it does not match unsat

; RUN: %solver %s | %OutputCheck %s
(set-logic QF_ABV)
(set-info :smt-lib-version 2.0)

(assert
 (= (_ bv0 8)
    (let ((?x (_ bv0 8)))
         ?x)))
; CHECK-NEXT: ^sat
(check-sat)
(exit)


; RUN: %solver %s | %OutputCheck %s
(set-logic QF_ABV)
(set-info :smt-lib-version 2.0)
(declare-fun symb_1_179 () (_ BitVec 8))

(assert
 (let ((?x true))
  (and
    (let ((?y true))
      ?y)
    ?x
)))
; CHECK-NEXT: sat
(check-sat)
(exit)

Change regexp so it does not match unsat

; RUN: %solver %s | %OutputCheck %s
(set-logic QF_ABV)
(set-info :smt-lib-version 2.0)
(declare-fun symb_1_179 () (_ BitVec 8))

(assert
 (let ((?x true))
  (and
    (let ((?y true))
      ?y)
    ?x
)))
; CHECK-NEXT: ^sat
(check-sat)
(exit)


Add test to check that having a CHECK-NEXT: following a CHECK-NOT-L: is considered invalid.

; RUN: sed 's/^;[ ]*CHECK.\+$//g' %s | not %OutputCheck %s 2> %t
; RUN: grep 'ERROR: ParsingException: CheckNotLiteral Directive' %t
; RUN: grep 'must have a CHECK: or CHECK-L: directive after it instead of a CheckNext Directive' %t

; CHECK-NOT-L: foo
something boo
; CHECK-NEXT: boo(5)
something boo(5) there goes


Add tiny bit more interesting SC example

s.boot;

// -- synths
SynthDef(\sine, { |freq=400, amp=0.5 |
    Out.ar(0, SinOsc.ar(freq, 0, amp))
}).add;

a = Synth(\sine);

// -- Put code to change the sound here -- !
var onChange = { |north=0, west=0, south=0, east=0|
    // Each value is in range 1-200 centimeter
    // 0 means out-of-range
    var closeness;
    "N:%, E:%, S:%, W:%\n".postf(north, east, south, west);

    // Simulate a Haravot dance
    // where people are in a circle, the closer the more intense. If one person does is not in circle: no sound!!
    north = (200-north)/200;
    west = (200-west)/200;
    south = (200-south)/200;
    east = (200-east)/200;
    closeness = north*west*south*east;
    a.set("amp", closeness*2);
};

// Standard code here. No need to change things here!
var win = Window.new("Simulator", Rect(200,200,200,200));
var north = Slider.new(win,Rect(0,30,30,170)).resize_(1);
var west = Slider.new(win,Rect(30,30,30,170)).resize_(1);
var south = Slider.new(win,Rect(60,30,30,170)).resize_(1);
var east = Slider.new(win,Rect(90,30,30,170)).resize_(1);
var onSliderChange = {
    var spec = ControlSpec.new(0, 200);
    onChange.value(spec.map(north.value), spec.map(west.value),
        spec.map(south.value), spec.map(east.value));
};
north.action = onSliderChange;
west.action = onSliderChange;
south.action = onSliderChange;
east.action = onSliderChange;
win.front;


Test the differences between two implementations of midifile playback

s.waitForBoot({

    var idHashMap= IdentityDictionary.new;
    var midifile, path, sampler;
    idHashMap.put(0,1);
    midifile=MIDIFile.new;
    sampler=midifile.initSampler(s,"~/Téléchargements/maestro".standardizePath);
  ~customPlay={

    path ="/home/pallamidessi/Téléchargements/con2-cm.mid";
    midifile.read(path);
    b={idHashMap};
    midifile.playTrack(0,"Nsec",s,b);
  };

  ~array={idHashMap};
  ~truc={arg  noteNr, velo, dur, upVelo, track, channel, absTime,
              lastTime, counter;
      var velocity="_mf";
      sampler.play(((""++(noteNr))++velocity).asSymbol,0,1,1,0.2);
      noteNr.postln;
      ~array.value.do({ arg note;
        if(note==2,{sampler.play(((""++(noteNr)+1)++velocity).asSymbol,0,1,1,0.2);});
        if(note==3,{sampler.play(((""++(noteNr)+2)++velocity).asSymbol,0,1,1,0.2);});
        if(note==4,{sampler.play(((""++(noteNr)+3)++velocity).asSymbol,0,1,1,0.2);});
      });
  };

  ~libPlay={
    var m;
    m = SimpleMIDIFile.read( "/home/pallamidessi/Téléchargements/con2-cm.mid" );

    // play it (cmd-. to stop)
    m.playNotesWithFunction(~truc,0,0); // takes a few seconds to start because this midifile starts with a rest

  };
  ~customPlay.value;
  //~libPlay.value;
})


//---------------------------------------------------------------------------------------
//  FILE:    CHXComGameVersion.uc
//  AUTHOR:  X2CommunityCore
//  PURPOSE: Version information for the Community Highlander.
//
//  Issue #1
//
//  Creates a template to hold the version number info for the Community Highlander
//  XComGame replacement. This version is incremented separately to the Long War
//  Game Version to express our own releases to mods depending on them.
//
//---------------------------------------------------------------------------------------
class CHXComGameVersion extends X2StrategyElement;

static function array<X2DataTemplate> CreateTemplates()
{
	local array<X2DataTemplate> Templates;
	local CHXComGameVersionTemplate XComGameVersion;
	`log("Creating CHXCOMGameVersionTemplate...", , 'X2WOTCCommunityHighlander');
	`CREATE_X2TEMPLATE(class'CHXComGameVersionTemplate', XComGameVersion, 'CHXComGameVersion');
	`log("Created CHXCOMGameVersionTemplate with version" @ XComGameVersion.MajorVersion $ "." $ XComGameVersion.MinorVersion $ "." $ XComGameVersion.PatchVersion, , 'X2WOTCCommunityHighlander');
	Templates.AddItem(XComGameVersion);

	return Templates;
}

Make sure final releases log properly

//---------------------------------------------------------------------------------------
//  FILE:    CHXComGameVersion.uc
//  AUTHOR:  X2CommunityCore
//  PURPOSE: Version information for the Community Highlander.
//
//  Issue #1
//
//  Creates a template to hold the version number info for the Community Highlander
//  XComGame replacement. This version is incremented separately to the Long War
//  Game Version to express our own releases to mods depending on them.
//
//---------------------------------------------------------------------------------------
class CHXComGameVersion extends X2StrategyElement;

static function array<X2DataTemplate> CreateTemplates()
{
	local array<X2DataTemplate> Templates;
	local CHXComGameVersionTemplate XComGameVersion;
	class'X2TacticalGameRuleset'.static.ReleaseScriptLog("X2WOTCCommunityHighlander: Creating CHXCOMGameVersionTemplate...");
	`CREATE_X2TEMPLATE(class'CHXComGameVersionTemplate', XComGameVersion, 'CHXComGameVersion');
	class'X2TacticalGameRuleset'.static.ReleaseScriptLog("X2WOTCCommunityHighlander: "Created CHXCOMGameVersionTemplate with version" @ XComGameVersion.MajorVersion $ "." $ XComGameVersion.MinorVersion $ "." $ XComGameVersion.PatchVersion");
	Templates.AddItem(XComGameVersion);

	return Templates;
}


<?xml version="1.0" encoding="UTF-8"?>
<faces-config>

	<faces-config-extension>
		<namespace-uri>http://www.gregorbyte.com/xsp/
		</namespace-uri>
		<default-prefix>gb</default-prefix>
	</faces-config-extension>

	<converter>
		<description>Converts a String into an Phone Number in
			International Format</description>
		<display-name>Phone Number Converter</display-name>
		<converter-id>gregorbyte.PhoneNumberConverter
		</converter-id>
		<converter-class>com.gregorbyte.xsp.converter.PhoneNumberConverter
		</converter-class>

		<property>
			<description>The default Country code to be used if the user does
				not specify one</description>
			<display-name>Default Country Code</display-name>
			<property-name>defaultCountryCode</property-name>
			<property-class>java.lang.String</property-class>
			<property-extension>
				<allow-run-time-binding>false</allow-run-time-binding>
			</property-extension>

		</property>

		<converter-extension>
			<tag-name>convertPhoneNumber</tag-name>
		</converter-extension>

	</converter>

</faces-config>

Update xsp-config to allow runtime value bindings for defaultCountryCode

<?xml version="1.0" encoding="UTF-8"?>
<faces-config>

	<faces-config-extension>
		<namespace-uri>http://www.gregorbyte.com/xsp/
		</namespace-uri>
		<default-prefix>gb</default-prefix>
	</faces-config-extension>

	<converter>
		<description>Converts a String into an Phone Number in
			International Format</description>
		<display-name>Phone Number Converter</display-name>
		<converter-id>gregorbyte.PhoneNumberConverter
		</converter-id>
		<converter-class>com.gregorbyte.xsp.converter.PhoneNumberConverter
		</converter-class>

		<property>
			<description>The default Country code to be used if the user does
				not specify one</description>
			<display-name>Default Country Code</display-name>
			<property-name>defaultCountryCode</property-name>
			<property-class>java.lang.String</property-class>
			<property-extension>
				<allow-run-time-binding>true</allow-run-time-binding>
			</property-extension>

		</property>

		<converter-extension>
			<tag-name>convertPhoneNumber</tag-name>
		</converter-extension>

	</converter>

</faces-config>