Commit Graph

122 Commits

Author SHA1 Message Date
Umur Ozkul
4628140069 numbers with units (tested) 2022-05-23 08:13:51 +02:00
Ozzie Gooen
f816f3c200 Ran prettier format 2022-05-22 13:02:54 -04:00
Ozzie Gooen
4b99e0135e Minor cleanup 2022-05-22 13:02:20 -04:00
Umur Ozkul
949b57c426 Error reporting if function arguments are defined
map(arr, toSample) now correctly reports

toSample not found

instead of

macro(Array,Symbol) not defined
2022-05-21 19:18:39 +02:00
Umur Ozkul
2265254531 Filter arguments passed to mathjs calls by type so that error messages are not too weird 2022-05-21 18:05:55 +02:00
Umur Ozkul
feb0284a89 format 2022-05-20 18:20:00 +02:00
Umur Ozkul
a17ea3f5a1 simplify error messages 2022-05-20 18:07:10 +02:00
Umur Ozkul
a314cd46fb . became a post operator that can operate on any expression
Because of
    $x.y[0][0].w + $x.z + $u.v
2022-05-20 17:46:02 +02:00
Umur Ozkul
2a176fac26 $indentified defined. Assignment not allowed 2022-05-20 17:24:06 +02:00
Umur Ozkul
1557c197a0 renamed internal variables starting with $ so that they are not overriden by $ variables in Squigle 2022-05-20 17:11:32 +02:00
Umur Ozkul
870b0c9d4e hidden macros 2022-05-20 17:05:53 +02:00
Umur Ozkul
b165ccac9f floats in scientific notation and optional leading zero 2022-05-20 15:18:27 +02:00
Umur Ozkul
c1f269e9a4 fixed logical operator priority 2022-05-20 00:29:04 +02:00
Umur Ozkul
a51e4be528 format 2022-05-19 20:25:18 +02:00
Umur Ozkul
986e7c744b pegjs->peggy 2022-05-19 19:10:14 +02:00
Umur Ozkul
749fba2877 pr fixes 2022-05-19 19:08:40 +02:00
Umur Ozkul
c496ae5cdd multi-line tests 2022-05-19 18:19:09 +02:00
Umur Ozkul
f547db9d0a multi line problem due to block and lambda ambiguity 2022-05-19 16:35:12 +02:00
Umur Ozkul
7b5fd2b101 Merge branch 'develop' into reducer-dev 2022-05-19 01:28:37 +02:00
Umur Ozkul
db050668d1 parser
toFunction

additive multiplicative

compact

whitespace

pow

relational equality

boolean

whitespace separator

left associative operators

expression

not

identifier

function call

array constructor

string

indexed values

ident

priority

block

outerBlock

optional final expression

statement separator

outerBlock

innerBlock

better errors

note xor

white space and record

unary minus

inner/outer block

statement

lambda

sort

lambda is a value constructor

lambdaCall

ternary

ternary

basicValue

cleanup

quotes

chained Functions

dot operators

unify unary operators

unify unary operatos

notes

notes

notes

notes

parser

priorities set

white space or newline defined

allow newlines

notes

function call has become a post operator

recordElement

recursive index

postOperatorToFunction

better integer

comments

notes

record priority

comment

atom

finalComment

generated parser

type cast

format

initiate test file

test initiated; todo nodeCall; nodeExpression

callIdentifier

recover extra

initiate testing

initial tests pass

tests pass

remove function node

ternary

test parse passed

to

tests pass

notes

sort

toExpression

format

notes

remove unused modules

remove unnecessary nodeLambdaCall

notes

note

fix construct array

comment test

todo

elixir pipe

fix toString

notes

initial to expression test

value test

parsing records

records

comments

ternary

ifthenelse

inner block passed

inner block

lambda

lambda

new parser tested

now test tricks

ternary in expression

to test lambda as argument

to test lambda in structures

Use peggy Parser

expectEvalError

macros tested

remove mathjs parse

reducer test

comparison operator
2022-05-19 01:23:43 +02:00
Ozzie Gooen
eafdfdc7b7 Cleanup to samplesMap() code 2022-05-16 20:11:38 -04:00
Ozzie Gooen
606f24ff24 Cleanup and addition of toInternalSampleArray 2022-05-15 21:34:36 -04:00
Ozzie Gooen
15965b0b05 First simple version of samplesMap 2022-05-15 17:24:54 -04:00
Quinn Dougherty
fd17da83b8 Merge remote-tracking branch 'origin/develop' into log-score-attempt 2022-05-05 20:42:39 -04:00
Umur Ozkul
99f54f596c ternary operator (tested) 2022-05-04 22:36:34 +02:00
Umur Ozkul
888b615445 Merge branch 'reducer-dev-F-ifthenelse' into ternary
packages/squiggle-lang/src/rescript/Reducer/Reducer_Dispatch/Reducer_Dispatch_BuiltInMacros.res
packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression.res
packages/squiggle-lang/src/rescript/Reducer/Reducer_Expression/Reducer_Expression_Builder.res
packages/squiggle-lang/src/rescript/Reducer/Reducer_MathJs/Reducer_MathJs_ToExpression.res
2022-05-04 21:51:15 +02:00
Umur Ozkul
ad220ed2b4 foreign function interface 2022-05-04 20:44:46 +02:00
Quinn Dougherty
cfa83e552d Merge remote-tracking branch 'origin/develop' into log-score-attempt 2022-05-04 13:05:40 -04:00
Quinn Dougherty
f5f5be2cfb ?? build broke, had to add a ModuleName. prefix to a constructor
Value: [1e-7 to 1e-5]
2022-05-04 11:43:44 -04:00
Umur Ozkul
5de6aa8e0d map reduce reduceReverse reverse keep 2022-05-04 17:32:25 +02:00
Umur Ozkul
ae48bd6420 pass reducer to dispatch
to define functions that has lambda arguments, dispatching requires a
reducer
2022-05-04 15:33:51 +02:00
Umur Ozkul
33ee0b27d5 remove inspect performance completely
Redesign required on the function interface
2022-05-04 15:14:34 +02:00
Umur Ozkul
11d4a3bc8b do not export private modules from Reducer module 2022-05-02 23:42:11 +02:00
Umur Ozkul
6a3b35eb4a fixed function f not bound 2022-05-02 23:12:57 +02:00
Umur Ozkul
5a0b436932 No 666 2022-05-02 18:00:47 +02:00
Umur Ozkul
9e41f0399f RENotAFunction 2022-05-02 15:55:02 +02:00
Umur Ozkul
ba104e4dfe Catching unreduced values. This is not a lazy language 2022-05-02 15:55:02 +02:00
Umur Ozkul
c68138e5f6 arity error 2022-05-02 14:19:04 +02:00
Umur Ozkul
c0fad8c668 define lambdaValue record as payload 2022-05-02 12:27:07 +02:00
Umur Ozkul
bbe8eced29 format 2022-04-29 19:31:34 +02:00
Umur Ozkul
3bbc5e7149 Add evaluate partial for back compatibility 2022-04-29 19:03:58 +02:00
Umur Ozkul
351381339c bug fixed
logs removed
2022-04-29 18:19:52 +02:00
Umur Ozkul
8e318a8aa9 refactor reducer
removed some extra array references

rename Builder to ExpressionBuilder

Expression Builder

Trash Warning

remove parsePartial/Outer, add context to lambda

format

module Bindings

simplify types

module Macro

reduceValueList

do macro call

result map

bindings stop replacing on macro calls

Macro Test

doBindStatement

bind a statement

bindings tested. TODO bind shadowing in lambda

block tests defined

block tests defined

blocks tested

macro lambda test defined
2022-04-29 16:40:32 +02:00
Umur Ozkul
7b052ee3c3 format 2022-04-27 22:24:06 +02:00
Umur Ozkul
d33f430073 Merge branch 'Umur-develop' into Umur-reducer-dev 2022-04-27 22:08:35 +02:00
Umur Ozkul
54f8b10a95 Reducer: Environment (Give environement to all function dispatches) - closes #169 2022-04-27 22:00:42 +02:00
Sam Nolan
ba412f2df6 Fix resolution issue 2022-04-26 14:15:37 -04:00
Umur Ozkul
7d4e3072b8 commite related issue note 2022-04-25 18:35:15 +02:00
Umur Ozkul
6878523186 cancel performance hook 2022-04-25 18:27:04 +02:00
Umur Ozkul
ac8827da28 ternary with bindings (failed) 2022-04-25 17:15:28 +02:00