oniksan / godobuf

A Google Protobuf implementation for Godot / GDScript
BSD 3-Clause "New" or "Revised" License
260 stars 36 forks source link

Field in Message called 'message' fail to convert #3

Closed Sharerer closed 5 years ago

Sharerer commented 5 years ago

Hello, If you have such message:

message Nop {
    string message = 1;
}

You will receive this error message from parser: error: Syntax error in construction 'string'. Unacceptable use 'message'

oniksan commented 5 years ago

Hi. "message" is the keyword. In this parser, the specification of tokenizer does not allow use keywords to other purposes, including field names. Keywords: message, double, float, int32, int64, uint32, uint64, sint32, sint64, fixed32, fixed64, sfixed32, sfixed64, bool, string, bytes, enum, map, oneof, true, false, syntax, import, package, option, service, reserved, weak, public, repeated, required, optional, allow_alias, custom_option, extensions, packed.

Solution: rename field.

Для Тараса Бульбы :) "message" - это ключевое слово. В данном парсере специфика разбивки на токены не позволяет использовать ключевые слова в качестве любых других назначений, в том числе имен полей. Переименуйте поле, по-другому никак.

Sharerer commented 5 years ago

Oh, well. That a solution. :D