File tree Expand file tree Collapse file tree 3 files changed +15
-9
lines changed
Expand file tree Collapse file tree 3 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -91,15 +91,10 @@ class Eval {
9191 public function eval ( expr : String ) : Value {
9292 if ( expr == null || expr == " " )
9393 return null ;
94- var exprs = expr .split (" :" );
95- var hint = HNone ;
96- if ( exprs .length > 1 ) {
97- hint = Value .parseHint (exprs .pop ()); // content after the last ":" is considered as a display hint
98- expr = exprs .join (" :" );
99- }
100- var expr = try parser .parseString (expr ) catch ( e : hscript. Expr . Error ) throw hscript. Printer .errorToString (e );
94+ var ext = Value .extractHint (expr );
95+ var expr = try parser .parseString (ext .expr ) catch ( e : hscript. Expr . Error ) throw hscript. Printer .errorToString (e );
10196 var v = evalExpr (expr );
102- v .hint = hint ;
97+ v .hint = ext . hint ;
10398 // additional convert based on hint
10499 v = makeValueWithHint (v );
105100 return v ;
Original file line number Diff line number Diff line change @@ -50,6 +50,16 @@ enum Hint {
5050
5151 // --- static ---
5252
53+ public static inline function extractHint ( expr : String ) : { expr : String , hint : Hint } {
54+ var exprs = expr .split (" :" );
55+ var hint = HNone ;
56+ if ( exprs .length > 1 ) {
57+ hint = Value .parseHint (exprs .pop ()); // content after the last ":" is considered as a display hint
58+ expr = exprs .join (" :" );
59+ }
60+ return { expr : expr , hint : hint };
61+ }
62+
5363 public static function parseHint ( s : String ) : Hint {
5464 if ( s == " h" )
5565 return HHex ;
Original file line number Diff line number Diff line change @@ -1087,7 +1087,8 @@ class HLAdapter extends DebugSession {
10871087 };
10881088 } else {
10891089 var value = dbg .getValue (args .expression );
1090- var v = makeVar (" " , value );
1090+ var ext = hld. Value .extractHint (args .expression );
1091+ var v = makeVar (ext .expr , value , ext .expr );
10911092 response .body = {
10921093 result : v .value ,
10931094 type : v .type ,
You can’t perform that action at this time.
0 commit comments