io7m-com / cedarbridge

Cedarbridge message protocol specification language
https://www.io7m.com/software/cedarbridge
ISC License
0 stars 0 forks source link

Expression sources off-by-one #19

Closed io7m closed 2 years ago

io7m commented 2 years ago

Creating a record with an invalid field yields this error:

ERROR: file:///home/rm/git/com.github/io7m/idstore/com.io7m.idstore.protocol.user.cb1/src/main/resources/com/io7m/idstore/protocol/user/cb1/User1.cbs:196:3: Unrecognized record member declaration.
  [field requestId IdU1UUID]]
  ^
  Object:        Record member
  Specification: https://www.io7m.com/software/cedarbridge/specification/index.xhtml#id_b43940c3-038f-4330-971f-ac76d56d5fad
  Expected:
    (parameter <type-parameter-name>)
  | (field <field-name> <type-expression>)
  | (documentation <name> <quoted-string>)

The problem is the [field requestId IdU1UUID]] line; although the line and column numbers are correct in the error message, the actual line displayed is the line after the line where the actual error occurred. Somewhere, an off-by-one error has snuck in and the expression source is being given the wrong value.