From d3b9418feab4e18223122068c3bfc7da8adfe32d Mon Sep 17 00:00:00 2001 From: Mattia Giambirtone Date: Tue, 14 Jun 2022 22:45:41 +0200 Subject: [PATCH] Added some missing files --- .vscode/configurationCache.log | 1 + .vscode/dryrun.log | 5 + .vscode/settings.json | 3 + .vscode/targets.log | 300 +++++++++++++++++++++++++++++++++ src/peon.nim | 11 ++ stdin.pbc | Bin 0 -> 107 bytes tests/calls.pbc | Bin 0 -> 314 bytes tests/calls.pn | 15 ++ tests/chainedCalls.pbc | Bin 0 -> 495 bytes tests/chainedCalls.pn | 26 +++ tests/closures.pbc | Bin 0 -> 219 bytes tests/dispatch.pbc | Bin 0 -> 212 bytes tests/functionObj.pbc | Bin 0 -> 139 bytes tests/functionObj.pn | 17 ++ tests/generics.pn | 16 ++ tests/nestedCalls.pbc | Bin 0 -> 223 bytes tests/nestedCalls.pn | 18 ++ tests/operators.pbc | Bin 0 -> 139 bytes tests/operators.pn | 6 + tests/returnFn.pbc | Bin 0 -> 212 bytes tests/returnFn.pn | 9 + 21 files changed, 427 insertions(+) create mode 100644 .vscode/configurationCache.log create mode 100644 .vscode/dryrun.log create mode 100644 .vscode/settings.json create mode 100644 .vscode/targets.log create mode 100644 src/peon.nim create mode 100644 stdin.pbc create mode 100644 tests/calls.pbc create mode 100644 tests/calls.pn create mode 100644 tests/chainedCalls.pbc create mode 100644 tests/chainedCalls.pn create mode 100644 tests/closures.pbc create mode 100644 tests/dispatch.pbc create mode 100644 tests/functionObj.pbc create mode 100644 tests/functionObj.pn create mode 100644 tests/generics.pn create mode 100644 tests/nestedCalls.pbc create mode 100644 tests/nestedCalls.pn create mode 100644 tests/operators.pbc create mode 100644 tests/operators.pn create mode 100644 tests/returnFn.pbc create mode 100644 tests/returnFn.pn diff --git a/.vscode/configurationCache.log b/.vscode/configurationCache.log new file mode 100644 index 0000000..800fda4 --- /dev/null +++ b/.vscode/configurationCache.log @@ -0,0 +1 @@ +{"buildTargets":["pretty","run"],"launchTargets":[],"customConfigurationProvider":{"workspaceBrowse":{"browsePath":[],"compilerArgs":[]},"fileIndex":[]}} \ No newline at end of file diff --git a/.vscode/dryrun.log b/.vscode/dryrun.log new file mode 100644 index 0000000..582bef5 --- /dev/null +++ b/.vscode/dryrun.log @@ -0,0 +1,5 @@ +make --dry-run --always-make --keep-going --print-directory +make: Entering directory '/home/nocturn9x/Desktop/peon' +nim --hints:off --warnings:off r src/test.nim +make: Leaving directory '/home/nocturn9x/Desktop/peon' + diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..65e1ec0 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "makefile.extensionOutputFolder": "./.vscode" +} \ No newline at end of file diff --git a/.vscode/targets.log b/.vscode/targets.log new file mode 100644 index 0000000..b7ba9ee --- /dev/null +++ b/.vscode/targets.log @@ -0,0 +1,300 @@ +make all --print-data-base --no-builtin-variables --no-builtin-rules --question +# GNU Make 4.3 +# Built for x86_64-pc-linux-gnu +# Copyright (C) 1988-2020 Free Software Foundation, Inc. +# License GPLv3+: GNU GPL version 3 or later +# This is free software: you are free to change and redistribute it. +# There is NO WARRANTY, to the extent permitted by law. + +# Make data base, printed on Tue Jun 14 09:42:22 2022 + +# Variables + +# environment +GDK_BACKEND = x11 +# environment +LC_ALL = C +# environment +NO_AT_BRIDGE = 1 +# environment +GTK_RC_FILES = /etc/gtk/gtkrc:/home/nocturn9x/.gtkrc:/home/nocturn9x/.config/gtkrc +# environment +VSCODE_IPC_HOOK_EXTHOST = /run/user/1000/vscode-ipc-6258d837-690b-477f-8d57-0859c0b5f31c.sock +# environment +LC_NAME = it_IT.UTF-8 +# environment +LC_NUMERIC = it_IT.UTF-8 +# environment +VSCODE_CWD = /home/nocturn9x/Desktop +# environment +LC_ADDRESS = it_IT.UTF-8 +# default +MAKE_COMMAND := make +# automatic +@D = $(patsubst %/,%,$(dir $@)) +# environment +DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = 1 +# environment +VSCODE_HANDLES_UNCAUGHT_ERRORS = true +# default +.VARIABLES := +# environment +PWD = /home/nocturn9x/Desktop/peon +# automatic +%D = $(patsubst %/,%,$(dir $%)) +# environment +MAIL = /var/spool/mail/nocturn9x +# environment +OLDPWD = /home/nocturn9x +# automatic +^D = $(patsubst %/,%,$(dir $^)) +# environment +VSCODE_LOG_STACK = false +# automatic +%F = $(notdir $%) +# environment +VSCODE_CODE_CACHE_PATH = /home/nocturn9x/.config/Code/CachedData/c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5 +# environment +XDG_SESSION_PATH = /org/freedesktop/DisplayManager/Session1 +# environment +LANG = C +# environment +XAUTHORITY = /home/nocturn9x/.Xauthority +# default +.LOADED := +# default +.INCLUDE_DIRS = /usr/include /usr/local/include /usr/include +# makefile +MAKEFLAGS = pqrR +# makefile +CURDIR := /home/nocturn9x/Desktop/peon +# environment +VSCODE_PIPE_LOGGING = true +# environment +APPLICATION_INSIGHTS_NO_DIAGNOSTIC_CHANNEL = 1 +# automatic +*D = $(patsubst %/,%,$(dir $*)) +# environment +PAM_KWALLET5_LOGIN = /run/user/1000/kwallet5.socket +# environment +MFLAGS = -pqrR +# default +.SHELLFLAGS := -c +# environment +XDG_CONFIG_DIRS = /home/nocturn9x/.config/kdedefaults:/etc/xdg +# automatic ++D = $(patsubst %/,%,$(dir $+)) +# environment +XCURSOR_THEME = macOSBigSur +# environment +XDG_SESSION_DESKTOP = KDE +# makefile (from 'Makefile', line 1) +MAKEFILE_LIST := Makefile +# automatic +@F = $(notdir $@) +# environment +VSCODE_VERBOSE_LOGGING = true +# environment +VSCODE_PID = 11972 +# environment +XDG_SESSION_TYPE = x11 +# automatic +?D = $(patsubst %/,%,$(dir $?)) +# environment +SESSION_MANAGER = local/lappy:@/tmp/.ICE-unix/3457,unix/lappy:/tmp/.ICE-unix/3457 +# automatic +*F = $(notdir $*) +# environment +QT_QPA_PLATFORMTHEME = gtk +# environment +CHROME_DESKTOP = code-url-handler.desktop +# environment +DBUS_SESSION_BUS_ADDRESS = unix:abstract=/tmp/dbus-Pq1hKAgSJq,guid=1348e9625cb7b6cc326324c262a6ee28 +# automatic +"), "
"), "
")) diff --git a/stdin.pbc b/stdin.pbc new file mode 100644 index 0000000000000000000000000000000000000000..5edc8358d080def475fb28dfe343f2714f5cd2ea GIT binary patch literal 107 zcmWG=_4kW+iVSge_IGh*U}Rv+O)M@+ElRaCNK7_LGf7P{PfavUvNSa@GfzrPH8nA| wOinQ}OfgEeuuQZtG-~^>B8dSAn1Gm(fq@^yh5#Uwo0oxs2Z$NGfzmz<0KkM5HUIzs literal 0 HcmV?d00001 diff --git a/tests/calls.pbc b/tests/calls.pbc new file mode 100644 index 0000000000000000000000000000000000000000..de9a6ca0077909cec547145fb5d367c73cc46c88 GIT binary patch literal 314 zcmXv|%TB^T6g`zkND7K3hHgkCBwE1*EhW=#E8U7QY+RX{K6cQg!V1EY4{+t@dS;3@ zxvz81eY_{Dx3BnfoxHA=2`scX@_Uz8{@hby=K0bSc@(BXrOH=x!M6O!cl&A^0c)U1xQ(JLV_CVilChrB znOlwh=fo3(zw!T40%A^VM#l UkMy~iyd4raXuzRA)ZpC|e|$b7%K!iX literal 0 HcmV?d00001 diff --git a/tests/calls.pn b/tests/calls.pn new file mode 100644 index 0000000..0a285e3 --- /dev/null +++ b/tests/calls.pn @@ -0,0 +1,15 @@ +fn noReturn(n: int) { + var n = n; + var `17` = 17; + return; +} + + +fn fooBar(a, b: int): int { + var baz = 38; + return a; +} + + +noReturn(1); +fooBar(1, 3); \ No newline at end of file diff --git a/tests/chainedCalls.pbc b/tests/chainedCalls.pbc new file mode 100644 index 0000000000000000000000000000000000000000..bce749dc838d5e71024d40ee08d06e15862477fe GIT binary patch literal 495 zcmZ9I%}N4M7=|DJrfBR>GObl@O4Nng)ELpGvQ=bJ1g&CzlmsnMp-prhuDgz)3u)OR zx{Ka98k7gld(OPy!#D4DE*j1AyQACd#&PqcK@6+s4Ti0LZKvwHm1@nax~=_s;QE1I z^Bs4$R^JcWK^TT!+wt76{(e95(OS@s!91iO3v)&nVHH-O1Zzgu;S_E}XJ8W&5KqzW z^asOj*n^}Di$N=Rd^g;_b1CY5mxsrnc-|1dY@ zGi%!a23x_?U#b>WEG&cLYGaRbkFdi}tN>vX;C&hG4N8F*&UvFGc1 z07jgtfG;2g41pST4)_LQWC!9r&O#jk7t*`1Bv$LP@@7iNFjfvRG3>h0Zcn kqs*NJHmX`_)y$K$v}%>KN^_&dYp}-{n z#r1GG=UI8oAuznF=c{=Hp|9o650o#PG%->e9q35LL6Vx*)OD@eNXa_++};|D0ZRZA zU<_oylJf#s{TLyzodSEHN0op#`m2dR1z0?@3-)XBt_MV}O>j7EVoxwFdf6crPM<11 T>-O^=$k5n6bw-SinR)mEh+7)& literal 0 HcmV?d00001 diff --git a/tests/functionObj.pbc b/tests/functionObj.pbc new file mode 100644 index 0000000000000000000000000000000000000000..cbf9415e7c6364c2a970273b0ed1a3f311e3b768 GIT binary patch literal 139 zcmWG=_4kW+iVSge_IGh*U}Rv+O)M@+ElRaCNK7_LGf7P{PfavUvNSa@GfzrPH8nA| zOinQ}OfgEeuuQZtG_w7?B8dSASb&(3fq|ESfsKKI2PDG4AOOTbF)(0)(vl1e+(1P< R;y}JPOpt?tLCDI70RTsc6@35z literal 0 HcmV?d00001 diff --git a/tests/functionObj.pn b/tests/functionObj.pn new file mode 100644 index 0000000..0b56322 --- /dev/null +++ b/tests/functionObj.pn @@ -0,0 +1,17 @@ +fn getFunction: fn (n: int): int { + fn inner(n: int): int { + return n; + } + return inner; +} + + +getFunction()(5); + + +operator `+`(a, b: int): int { + #pragma[magic: "AddInt64"] +} + + +`+`(1, 2); \ No newline at end of file diff --git a/tests/generics.pn b/tests/generics.pn new file mode 100644 index 0000000..acf9ebb --- /dev/null +++ b/tests/generics.pn @@ -0,0 +1,16 @@ +operator `+`(a, b: int): int { + #pragma[magic: "AddInt64", pure] +} + + +operator `+`(a, b: int32): int32 { + #pragma[magic: "AddInt64", pure] +} + + +fn sum[T](a, b: T): T { + return a + b; +} + +sum(1, 2); +sum(1'i32, 2'i32); \ No newline at end of file diff --git a/tests/nestedCalls.pbc b/tests/nestedCalls.pbc new file mode 100644 index 0000000000000000000000000000000000000000..ea74bcc43492cefe1a68739f9d59d2d0212fc97e GIT binary patch literal 223 zcmW-aI}5@<5QHbeNFZmSpw<>bFc#(^mtbd1X=0JaN^(gA3m^Evzv7?szc}Y`yWH*! z-|n&^Kdkp!xX{V^ql|{@y+c zREOmNJzxN&z?Aa{nEV~X!s&8p?|onen1Es9`r?)HeYF|1SXw(WNDw*yGsavGh+M%o g<}_b=2A@N$2$|5k8Sm=-&;%Xw#a4qT?F>Bp0H)F)HUIzs literal 0 HcmV?d00001 diff --git a/tests/nestedCalls.pn b/tests/nestedCalls.pn new file mode 100644 index 0000000..e626fa2 --- /dev/null +++ b/tests/nestedCalls.pn @@ -0,0 +1,18 @@ +fn outer: int { + fn inner: int { + return 69420; + } + return inner(); +} + + +fn outerTwo(n: int): int { + fn inner(z: int): int { + return z; + } + return inner(n); +} + + +outerTwo(5); +outer(); \ No newline at end of file diff --git a/tests/operators.pbc b/tests/operators.pbc new file mode 100644 index 0000000000000000000000000000000000000000..5769cf41e1f53163598ffacd8600588a7b3557d4 GIT binary patch literal 139 zcmWG=_4kW+iVSge_IGh*U}Rv+O)M@+ElRaCNK7_LGf7P{PfavUvNSa@GfzrPH8nA| zOinQ}OfgEeuuQZtG@7w|MG^xLumCY50|PGu0~-Sa4@iW8K>&!Ez$^qU$-ux3RKz0= Q6nBP6axgFm8M!b3087jjbpQYW literal 0 HcmV?d00001 diff --git a/tests/operators.pn b/tests/operators.pn new file mode 100644 index 0000000..3ee6e48 --- /dev/null +++ b/tests/operators.pn @@ -0,0 +1,6 @@ +operator `+`(a, b: int): int { + #pragma[magic: "AddInt64", pure] +} + + +2 + 2; # Works! :D \ No newline at end of file diff --git a/tests/returnFn.pbc b/tests/returnFn.pbc new file mode 100644 index 0000000000000000000000000000000000000000..7b9b101d10267a9c80721ea99e0a05f2b2bf3b33 GIT binary patch literal 212 zcmX9%!4APt5S)h!X(dEN93;YXa6ntF_QegwNl9Fs}+PTv%7~N z++UXGQ?Lrx0T{}6`FyEN2~)=Q)lreBq#Fs>nR}5`t}_#HVq1x=d?9_y-X1>@2qhu| zYCsiO0DbZ;pa&Fbpy8ILDysvdUkn-^Z~9XCZ&3$!fKKbihV-BSbUQ=?7`Mp`r<_qu Y8YDU6OebM@d6FKRMvxyM