Git Product home page Git Product logo

Comments (4)

lmorg avatar lmorg commented on June 1, 2024 1

Good spot.

The parser for object creator was a little slapdash. I'm pretty sure I wrote that code wrapped under a blanket while fighting off covid. Which also explains why the tests aren't thorough enough.

I'm going to merge the changes I have currently and will rewrite the object creator parser for a new release.

from murex.

lmorg avatar lmorg commented on June 1, 2024

Looks like you've uncovered not one, but two bugs in the parser.

null bareword parsed as string:

» %{ "foo": null }
{
    "foo": "null"
}

variables are tokenised for is-null parameters

» $foo = "bar"
» is-null foo
foo: defined and not null
» is-null $foo
bar: undefined or null

Both of these are trivially fixable so I'll get an update pushed to develop shortly

from murex.

lmorg avatar lmorg commented on June 1, 2024

@tiymat pushed a fix to develop. I'll probably put this live in the next day or two because it's a low impact change.

from murex.

tiymat avatar tiymat commented on June 1, 2024

In testing the develop version (5.3.7000) I noticed a potentially-related issue.

In JSON objects constructed with %{} syntax, is-null seems to interpret empty strings as nulls, contradicting the documentation which says "Zero length strings [...] are all not null."

tmp » cat test.mx
#!/usr/bin/murex

%{ "foo": "" } -> formap key value {
	if { is-null value } then {
		out "value is null"
	} else {
		out "value is NOT null"
	}
}
tmp » ./test.mx
value is null

Edit: I guess the issue isn't with is-null itself but rather how the JSON object is being parsed/constructed.

~ » %{ "foo": '' }
{
    "foo": null
}

from murex.

Related Issues (20)

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.