Commit 1a9eef9f authored by Arjan Oortgiese's avatar Arjan Oortgiese

The function id generated by the C backed was used. For example the Lambda...

The function id generated by the C backed was used. For example the Lambda function name is \;19;31;5.6, the 6 is used instead of the 5. We remove thus first the function id from the C backed  before processing the name.
parent 712c940d
......@@ -417,6 +417,7 @@ droplast [x:xs] = [x:droplast xs]
makeSaplName :: String -> String
makeSaplName str
| startsWith "TD;" str = str
# str = remove_c_functie_number str
# lstr = [c\\ c <-: str]
# revl = reverse lstr
# (dgs,revrest) = span isDigit revl
......@@ -429,6 +430,32 @@ makeSaplName str
| dgs <> [] = (fname +++ toString (reverse dgs))
= fname
// The Lambda function name is for example: \;19;31;5.6 the .6 is generated by C (function id)
// This function removes that.
remove_c_functie_number :: String -> String
remove_c_functie_number name
# (okSeperator, posSeperator) = charIndexBackwards name (size name - 1) ';'
# (okDot, posDot) = charIndexBackwards name (size name - 1) '.'
| okDot && okSeperator && posSeperator < posDot
# before = name % (0,posSeperator - 1)
# clean_function_number = name % (posSeperator + 1, posDot - 1)
# c_function_number = name % (posDot + 1, size name - 1)
| is_number clean_function_number && is_number c_function_number = before +++ ";" +++ clean_function_number
= name
= name
where
is_number :: String -> Bool
is_number string = isEmpty [c \\ c <-: string | not (isDigit c)]
charIndexBackwards :: !String !Int !Char -> (!Bool,!Int)
charIndexBackwards s i char
| i == (-1)
= (False,size s)
| s.[i] == char
= (True,i)
= charIndexBackwards s (i-1) char
remsc [';':rs] = rs
remsc rs = rs
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment