0
這是使用GNAT IDE的Ada 2012。我在'Ada'程序中收到'value:error'的錯誤輸入
我想測試我的項目,我收到以下錯誤
bad input for 'Value: "x "
作爲唯一輸出到控制檯。我認爲這個問題來自這個功能;
function get_next_id(lex: in out Lexical_Analyzer) return Id is
tok: Token := get_lookahead_token(lex);
tok_type: Token_Type := get_token_type(tok);
theId: Id;
begin
match(tok, ID_TOK);
get_next_token(lex, tok);
theId := create_id(Character'Value(String(get_lexeme(tok)))); -- Problem caused here?
return theId;
end get_next_id;
我認爲這是導致我的問題,這似乎是試圖把X和下面的白色空間轉換。我如何才能讀取第一個元素?
索引字符串的? – NWS