The code wii return an error:
print('x > 1')Parsing: -1.3e-44 results in:
<negate p="32">
<real p="32">1.3e-44</real>
</negate>Parsing: - 1.3 e - 44 results in:
<negate p="29">
<real p="29">1.3</real>
</negate>
<minus p="36">
<variable p="31">e</variable>
<integer p="36">44</integer>
</minus>rol helloworld.rol helloworld.rolWARNING: the following files are disregarded:
/Users/glopes/Projects/RoboticsLanguage/Examples/helloworld.rol
In the custom language operator definition the first parameter cannot be ''. This works:
'functionDefinition': {
'input': {
'RoL': {
'custom': ['define', ':','->',',','->', '']
}
},
...An so a function can be defined in RoL by:
define f:R -> R,
x -> x+1
This does not work:
'functionDefinition': {
'input': {
'RoL': {
'custom': ['', ':','->',',','->', '']
}
},
...f:R -> R,
x -> x+1
The function cache can store static elements in a file saved at ~/.ros/cache. If the cache exists it loads the data from a file. Otherwise, it uses the function functionThatCreatesData to generate the data online:
data = cache('name', functionThatCreatesData )the RoL parser currently works by generating the composition of
strings of text (see functions xml and xmlInfix) that are eventually parsed into XML.
This makes the implementation simple but my incur some performance issues when mini languages
are used. Mini languages return XML objects that are converted to text to integrate into the language.
When this parser returns the result is converts everything into an XML object, which means that the mini
language code is converted to xml text and then back to XML objects, thus waisting CPU time. If performance
become critical in the future this should be addressed.