finos / rune-dsl

The project containing the Rune DSL grammar and default code generators
Apache License 2.0
25 stars 30 forks source link

`exists` not highlighted properly #575

Open SimonCockx opened 1 year ago

SimonCockx commented 1 year ago

In the following example, exists is not highlighted as a keyword.

func FindLatestAssignedIdentifier:
    inputs:
        tradeIdentifier TradeIdentifier (1..1)
    output:
        assignedIdentifier AssignedIdentifier (1..1)

    alias assignedIdentifiersWithVersion:
        tradeIdentifier -> assignedIdentifier filter version exists

It is highlighted properly when changed to

    alias assignedIdentifiersWithVersion:
        tradeIdentifier -> assignedIdentifier filter item -> version exists
SimonCockx commented 1 year ago

Similar, this one fails to highlight properly:

type AssetPool: <"Characterizes the asset pool behind an asset backed bond.">

    version string (0..1) <"The asset pool version.">
    effectiveDate date (0..1) <"Optionally it is possible to specify a version effective date when a version is supplied.">
    initialFactor number (1..1) <"The part of the mortgage that is outstanding on trade inception, i.e. has not been repaid yet as principal. It is expressed as a multiplier factor to the mortgage: 1 means that the whole mortgage amount is outstanding, 0.8 means that 20% has been repaid.">
    currentFactor number (0..1) <"The part of the mortgage that is currently outstanding. It is expressed similarly to the initial factor, as factor multiplier to the mortgage. This term is formally defined as part of the 'ISDA Standard Terms Supplement for use with credit derivatives transactions on mortgage-backed security with pas-as-you-go or physical settlement'.">

    condition EffectiveDate: <"FpML specifies that it is possible to specify a version effective date when a versionId is supplied.">
        if version is absent
        then effectiveDate is absent
SimonCockx commented 1 year ago

Same for post-condition in

func Create_SecurityTransfer: <"Defines the creation of a Transfer, given a Trade State and date.">
    inputs:
        tradeState TradeState (1..1)
        date date (1..1)
        quantity Quantity (0..1) <"Specifies quantity amount returned if not the full amount from the TradeState, e.g. partial return">
    output:
        transfer Transfer (1..1)

    post-condition UnitsAndObservable:
        if tradeState -> trade -> tradableProduct -> product -> security exists
            and tradeState -> trade -> tradableProduct -> tradeLot -> priceQuantity -> settlementTerms -> transferSettlementType only-element = TransferSettlementEnum -> DeliveryVersusPayment
        then transfer -> quantity -> unit -> currency only exists
            and transfer -> observable -> productIdentifier exists