also add unit THz as requested

This commit is contained in:
donovaly
2019-12-23 02:49:30 +01:00
committed by wwmayer
parent edd97de6a2
commit a6a043a6f2
8 changed files with 322 additions and 304 deletions

View File

@@ -174,6 +174,7 @@ EXPO [eE][-+]?[0-9]+
"kHz" COUNTCHARS; yylval.quantity.scaler = Quantity::KiloHertz; yylval.quantity.unitStr = yytext; return UNIT; // kilo Hertz
"MHz" COUNTCHARS; yylval.quantity.scaler = Quantity::MegaHertz; yylval.quantity.unitStr = yytext; return UNIT; // mega Hertz
"GHz" COUNTCHARS; yylval.quantity.scaler = Quantity::GigaHertz; yylval.quantity.unitStr = yytext; return UNIT; // giga Hertz
"THz" COUNTCHARS; yylval.quantity.scaler = Quantity::TeraHertz; yylval.quantity.unitStr = yytext; return UNIT; // tera Hertz
"ug" COUNTCHARS; yylval.quantity.scaler = Quantity::MicroGram; yylval.quantity.unitStr = yytext; return UNIT; // micro gram
"\xC2\xB5g" COUNTCHARS; yylval.quantity.scaler = Quantity::MicroGram; yylval.quantity.unitStr = yytext; return UNIT; // micro gram

View File

@@ -645,6 +645,7 @@ App.Units.Hertz = App.Units.Quantity('Hz')
App.Units.KiloHertz = App.Units.Quantity('kHz')
App.Units.MegaHertz = App.Units.Quantity('MHz')
App.Units.GigaHertz = App.Units.Quantity('GHz')
App.Units.TeraHertz = App.Units.Quantity('THz')
App.Units.MicroGram = App.Units.Quantity('ug')
App.Units.MilliGram = App.Units.Quantity('mg')