-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Description
Description
The INLINE keyword modifier on function declarations is not recognized by the parser. This is a standard occam feature (not occam-pi).
Syntax
INT INLINE FUNCTION seconds (VAL INT s)
INT ticks:
VALOF
ticks := s * 1000000
RESULT ticks
:
The INLINE keyword appears between the return type and FUNCTION keyword, indicating the function should be inlined at call sites.
Affected files
kroc/modules/course/examples/bar.occ(3 occurrences: lines 29, 45, 61)
Current error
bar.occ:29: expected :, got FUNCTION
The parser sees INT as a type and then expects a : (variable declaration), but encounters INLINE FUNCTION which it doesn't understand.
Proposed approach
For transpilation purposes, INLINE is purely an optimization hint and can be ignored — the function should be parsed and generated exactly as if INLINE were absent. The parser just needs to skip the INLINE keyword when it appears before FUNCTION in a declaration context.
Related
- Course examples: unimplemented features preventing transpilation #43 - Course examples tracking issue
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels