nitc :: ToolContext :: parse_propdef
Fatal error if the string
is not a syntactically correct property definition
# Parse a full propdef given as a string
# Fatal error if the `string` is not a syntactically correct property definition
fun parse_propdef(string: String): APropdef
do
var mod_string = "class Dummy\n{string}\nend"
var nclassdef = parse_classdef(mod_string)
var npropdefs = nclassdef.n_propdefs
if npropdefs.length != 1 then
self.fatal_error(null, "Fatal Error: not a propdef.")
abort
end
return npropdefs.first
end
src/parser_util.nit:52,2--64,4