diff options
| author | Ben Winston | 2023-05-22 20:12:40 -0400 |
|---|---|---|
| committer | Ben Winston | 2023-05-22 20:12:40 -0400 |
| commit | b7fba62e9f1f9f7a5a67fd64d4aed55646d1b58e (patch) | |
| tree | 42c192475ed3e17dd57203cab03b41f1cbca40a9 /parser.d | |
| parent | 229859cde2f0dae4714b972cf18e923027db265c (diff) | |
runtime type checking
Diffstat (limited to 'parser.d')
| -rw-r--r-- | parser.d | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -262,6 +262,7 @@ enum ValueType { STRING, NUMBER, BOOLEAN, + TYPE, OBJ, } @@ -269,6 +270,7 @@ union As { bool boolean; double number; string str; + string type; Obj obj; } @@ -302,6 +304,12 @@ Value makeObjValue(Obj obj) { return val; } +Value makeTypeValue(string name) { + As as = { type: name }; + Value val = { ValueType.TYPE, as }; + return val; +} + class Parser { string source; |
