Nov.20.2018 -- CAlive to introduce abbreviation support

12 views
Skip to first unread message

Rick C. Hodgin

unread,
Nov 20, 2018, 3:49:50 PM11/20/18
to caliveprogra...@googlegroups.com
CAlive will allow token abbreviation when the indicated portions are uniquely identified in the range of tokens in scope.

    // Declare a function
    function verify_data_is_valid
    | params s32 input, s32 low, s32 high
    | returns bool valid
    {
        valid = between(input, low, high);
    }

    // Use in other code:
    if (verify(lnValue, lnMinVal, lnMaxVal))
        printf("Valid\n");
    else
        printf("Invalid\n");

    // Simplified even further:
    if (verify(Value, Min, Max))  // Assumes "lnValue", "lnMinVal", and "lnMaxVal" by their unique parts

-- 
Rick C. Hodgin

Reply all
Reply to author
Forward
0 new messages