mirror of
https://github.com/octoleo/plantuml.git
synced 2024-12-25 20:11:18 +00:00
fix: ord
builtin function: retrieve then cast of the value
By this indication: - https://github.com/plantuml/plantuml/pull/1487#issuecomment-1646545778 Fix `ord` builtin function: - retrieve then cast of the value
This commit is contained in:
parent
6e7254377c
commit
823d27afa9
@ -59,7 +59,8 @@ public class Ord extends SimpleReturnFunction {
|
||||
public TValue executeReturnFunction(TContext context, TMemory memory, LineLocation location, List<TValue> values,
|
||||
Map<String, TValue> named) throws EaterException, EaterExceptionLocated {
|
||||
try {
|
||||
final int value = (int) values.get(0).toString();
|
||||
final char firstChar = values.get(0).toString().charAt(0);
|
||||
final int value = (int) firstChar;
|
||||
return TValue.fromInt(value);
|
||||
} catch (Throwable t) {
|
||||
return TValue.fromInt(0);
|
||||
|
Loading…
Reference in New Issue
Block a user