Mercurial Hosting > luan
diff src/luan/modules/parsers/Css.java @ 1330:f41919741100
fix security
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 11 Feb 2019 01:38:55 -0700 |
parents | 8d54bcc0b6d3 |
children | 25746915a241 |
line wrap: on
line diff
--- a/src/luan/modules/parsers/Css.java Sun Feb 10 02:01:49 2019 -0700 +++ b/src/luan/modules/parsers/Css.java Mon Feb 11 01:38:55 2019 -0700 @@ -2,13 +2,18 @@ import luan.LuanState; import luan.LuanTable; +import luan.LuanException; import luan.lib.parser.Parser; public final class Css { public static LuanTable style(LuanState luan,String text) { - return new Css(luan,text).parseStyle(); + try { + return new Css(luan,text).parseStyle(); + } catch(LuanException e) { + throw new RuntimeException(e); + } } private final LuanState luan; @@ -19,7 +24,7 @@ this.parser = new Parser(text); } - private LuanTable parseStyle() { + private LuanTable parseStyle() throws LuanException { LuanTable tbl = new LuanTable(luan); while( matchSpace() ); while( !parser.endOfInput() ) { @@ -37,7 +42,7 @@ while( !parser.endOfInput() && parser.noneOf(";") ); String val = parser.textFrom(start).trim(); - tbl.rawPut(prop,val); + tbl.put(prop,val); parser.match(';'); while( matchSpace() ); }