CordyJ / Open-TuringPlus

Open Turing+ programming language compiler
Other
8 stars 2 forks source link

Predefined types are not allowed in calls to size() #10

Closed dnewhall closed 4 months ago

dnewhall commented 4 months ago

I'm a bit surprised to see that this doesn't work:

put size(int)

Line 1 of malloctest.t: Syntax error at ')'  -  '@' expected

But this works:

type _int : int
put size(_int)

I suppose you can work around it, but it prevents things like startOfBlock + (size(int1) * offset)

CordyJ commented 4 months ago

Yes, that's true, size() is an attribute of a namedType in Turing. A standardType is not namedType. Documentation of the Turing and Turing+ languages can be found here: https://github.com/CordyJ/Open-TuringPlus/tree/main/doc