diff src/luan/modules/parsers/BBCode.java @ 1335:e0cf0d108a77

major cleanup
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 14 Feb 2019 03:10:45 -0700
parents 25746915a241
children 27efb1fcbcb5
line wrap: on
line diff
--- a/src/luan/modules/parsers/BBCode.java	Tue Feb 12 22:53:57 2019 -0700
+++ b/src/luan/modules/parsers/BBCode.java	Thu Feb 14 03:10:45 2019 -0700
@@ -12,23 +12,21 @@
 
 public final class BBCode {
 
-	public static String toHtml(Luan luan,String bbcode,LuanFunction quoter) throws LuanException {
-		return new BBCode(luan,bbcode,quoter,true).parse();
+	public static String toHtml(String bbcode,LuanFunction quoter) throws LuanException {
+		return new BBCode(bbcode,quoter,true).parse();
 	}
 
-	public static String toText(Luan luan,String bbcode,LuanFunction quoter) throws LuanException {
-		return new BBCode(luan,bbcode,quoter,false).parse();
+	public static String toText(String bbcode,LuanFunction quoter) throws LuanException {
+		return new BBCode(bbcode,quoter,false).parse();
 	}
 
-	private final Luan luan;
 	private final Parser parser;
 	private final LuanFunction quoter;
 	private final boolean toHtml;
 
-	private BBCode(Luan luan,String text,LuanFunction quoter,boolean toHtml) throws LuanException {
+	private BBCode(String text,LuanFunction quoter,boolean toHtml) throws LuanException {
 		Utils.checkNotNull(text,1);
 //		Utils.checkNotNull(quoter,2);
-		this.luan = luan;
 		this.parser = new Parser(text);
 		this.quoter = quoter;
 		this.toHtml = toHtml;
@@ -285,7 +283,7 @@
 			else
 				return "";
 		}
-		Object obj = quoter.call(luan,args);
+		Object obj = quoter.call(args);
 		if( !(obj instanceof String) )
 			throw new LuanException("BBCode quoter function returned "+Luan.type(obj)+" but string required");
 		return (String)obj;