This commit is contained in:
Adam D. Ruppe 2019-12-17 08:36:31 -05:00
parent b490ed1ab5
commit 643527c897
2 changed files with 109 additions and 102 deletions

200
dom.d
View File

@ -3963,11 +3963,11 @@ dchar parseEntity(in dchar[] entity) {
case "Tab": return '\u0009'; case "Tab": return '\u0009';
case "NewLine": return '\u000A'; case "NewLine": return '\u000A';
case "excl": return '\u0021'; case "excl": return '\u0021';
case "QUOT,": return '\u0022'; case "QUOT": return '\u0022';
case "num": return '\u0023'; case "num": return '\u0023';
case "dollar": return '\u0024'; case "dollar": return '\u0024';
case "percnt": return '\u0025'; case "percnt": return '\u0025';
case "AMP,": return '\u0026'; case "AMP": return '\u0026';
case "lpar": return '\u0028'; case "lpar": return '\u0028';
case "rpar": return '\u0029'; case "rpar": return '\u0029';
case "ast": case "midast": return '\u002A'; case "ast": case "midast": return '\u002A';
@ -3977,9 +3977,9 @@ dchar parseEntity(in dchar[] entity) {
case "sol": return '\u002F'; case "sol": return '\u002F';
case "colon": return '\u003A'; case "colon": return '\u003A';
case "semi": return '\u003B'; case "semi": return '\u003B';
case "LT,": return '\u003C'; case "LT": return '\u003C';
case "equals": return '\u003D'; case "equals": return '\u003D';
case "GT,": return '\u003E'; case "GT": return '\u003E';
case "quest": return '\u003F'; case "quest": return '\u003F';
case "commat": return '\u0040'; case "commat": return '\u0040';
case "lsqb": case "lbrack": return '\u005B'; case "lsqb": case "lbrack": return '\u005B';
@ -3991,102 +3991,102 @@ dchar parseEntity(in dchar[] entity) {
case "lcub": case "lbrace": return '\u007B'; case "lcub": case "lbrace": return '\u007B';
case "verbar": case "vert": case "VerticalLine": return '\u007C'; case "verbar": case "vert": case "VerticalLine": return '\u007C';
case "rcub": case "rbrace": return '\u007D'; case "rcub": case "rbrace": return '\u007D';
case "nbsp,": case "NonBreakingSpace": return '\u00A0'; case "nbsp": case "NonBreakingSpace": return '\u00A0';
case "iexcl,": return '\u00A1'; case "iexcl": return '\u00A1';
case "cent,": return '\u00A2'; case "cent": return '\u00A2';
case "pound,": return '\u00A3'; case "pound": return '\u00A3';
case "curren,": return '\u00A4'; case "curren": return '\u00A4';
case "yen,": return '\u00A5'; case "yen": return '\u00A5';
case "brvbar,": return '\u00A6'; case "brvbar": return '\u00A6';
case "sect,": return '\u00A7'; case "sect": return '\u00A7';
case "Dot": case "die": case "DoubleDot": case "uml,": return '\u00A8'; case "Dot": case "die": case "DoubleDot": case "uml": return '\u00A8';
case "copy,": case "COPY,": return '\u00A9'; case "copy": case "COPY": return '\u00A9';
case "ordf,": return '\u00AA'; case "ordf": return '\u00AA';
case "laquo,": return '\u00AB'; case "laquo": return '\u00AB';
case "not,": return '\u00AC'; case "not": return '\u00AC';
case "shy,": return '\u00AD'; case "shy": return '\u00AD';
case "reg,": case "circledR": case "REG,": return '\u00AE'; case "reg": case "circledR": case "REG": return '\u00AE';
case "macr,": case "strns": return '\u00AF'; case "macr": case "strns": return '\u00AF';
case "deg,": return '\u00B0'; case "deg": return '\u00B0';
case "plusmn,": case "pm": case "PlusMinus": return '\u00B1'; case "plusmn": case "pm": case "PlusMinus": return '\u00B1';
case "sup2,": return '\u00B2'; case "sup2": return '\u00B2';
case "sup3,": return '\u00B3'; case "sup3": return '\u00B3';
case "acute,": case "DiacriticalAcute": return '\u00B4'; case "acute": case "DiacriticalAcute": return '\u00B4';
case "micro,": return '\u00B5'; case "micro": return '\u00B5';
case "para,": return '\u00B6'; case "para": return '\u00B6';
case "middot,": case "centerdot": case "CenterDot": return '\u00B7'; case "middot": case "centerdot": case "CenterDot": return '\u00B7';
case "cedil,": case "Cedilla": return '\u00B8'; case "cedil": case "Cedilla": return '\u00B8';
case "sup1,": return '\u00B9'; case "sup1": return '\u00B9';
case "ordm,": return '\u00BA'; case "ordm": return '\u00BA';
case "raquo,": return '\u00BB'; case "raquo": return '\u00BB';
case "frac14,": return '\u00BC'; case "frac14": return '\u00BC';
case "frac12,": case "half": return '\u00BD'; case "frac12": case "half": return '\u00BD';
case "frac34,": return '\u00BE'; case "frac34": return '\u00BE';
case "iquest,": return '\u00BF'; case "iquest": return '\u00BF';
case "Agrave,": return '\u00C0'; case "Agrave": return '\u00C0';
case "Aacute,": return '\u00C1'; case "Aacute": return '\u00C1';
case "Acirc,": return '\u00C2'; case "Acirc": return '\u00C2';
case "Atilde,": return '\u00C3'; case "Atilde": return '\u00C3';
case "Auml,": return '\u00C4'; case "Auml": return '\u00C4';
case "Aring,": case "angst": return '\u00C5'; case "Aring": case "angst": return '\u00C5';
case "AElig,": return '\u00C6'; case "AElig": return '\u00C6';
case "Ccedil,": return '\u00C7'; case "Ccedil": return '\u00C7';
case "Egrave,": return '\u00C8'; case "Egrave": return '\u00C8';
case "Eacute,": return '\u00C9'; case "Eacute": return '\u00C9';
case "Ecirc,": return '\u00CA'; case "Ecirc": return '\u00CA';
case "Euml,": return '\u00CB'; case "Euml": return '\u00CB';
case "Igrave,": return '\u00CC'; case "Igrave": return '\u00CC';
case "Iacute,": return '\u00CD'; case "Iacute": return '\u00CD';
case "Icirc,": return '\u00CE'; case "Icirc": return '\u00CE';
case "Iuml,": return '\u00CF'; case "Iuml": return '\u00CF';
case "ETH,": return '\u00D0'; case "ETH": return '\u00D0';
case "Ntilde,": return '\u00D1'; case "Ntilde": return '\u00D1';
case "Ograve,": return '\u00D2'; case "Ograve": return '\u00D2';
case "Oacute,": return '\u00D3'; case "Oacute": return '\u00D3';
case "Ocirc,": return '\u00D4'; case "Ocirc": return '\u00D4';
case "Otilde,": return '\u00D5'; case "Otilde": return '\u00D5';
case "Ouml,": return '\u00D6'; case "Ouml": return '\u00D6';
case "times,": return '\u00D7'; case "times": return '\u00D7';
case "Oslash,": return '\u00D8'; case "Oslash": return '\u00D8';
case "Ugrave,": return '\u00D9'; case "Ugrave": return '\u00D9';
case "Uacute,": return '\u00DA'; case "Uacute": return '\u00DA';
case "Ucirc,": return '\u00DB'; case "Ucirc": return '\u00DB';
case "Uuml,": return '\u00DC'; case "Uuml": return '\u00DC';
case "Yacute,": return '\u00DD'; case "Yacute": return '\u00DD';
case "THORN,": return '\u00DE'; case "THORN": return '\u00DE';
case "szlig,": return '\u00DF'; case "szlig": return '\u00DF';
case "agrave,": return '\u00E0'; case "agrave": return '\u00E0';
case "aacute,": return '\u00E1'; case "aacute": return '\u00E1';
case "acirc,": return '\u00E2'; case "acirc": return '\u00E2';
case "atilde,": return '\u00E3'; case "atilde": return '\u00E3';
case "auml,": return '\u00E4'; case "auml": return '\u00E4';
case "aring,": return '\u00E5'; case "aring": return '\u00E5';
case "aelig,": return '\u00E6'; case "aelig": return '\u00E6';
case "ccedil,": return '\u00E7'; case "ccedil": return '\u00E7';
case "egrave,": return '\u00E8'; case "egrave": return '\u00E8';
case "eacute,": return '\u00E9'; case "eacute": return '\u00E9';
case "ecirc,": return '\u00EA'; case "ecirc": return '\u00EA';
case "euml,": return '\u00EB'; case "euml": return '\u00EB';
case "igrave,": return '\u00EC'; case "igrave": return '\u00EC';
case "iacute,": return '\u00ED'; case "iacute": return '\u00ED';
case "icirc,": return '\u00EE'; case "icirc": return '\u00EE';
case "iuml,": return '\u00EF'; case "iuml": return '\u00EF';
case "eth,": return '\u00F0'; case "eth": return '\u00F0';
case "ntilde,": return '\u00F1'; case "ntilde": return '\u00F1';
case "ograve,": return '\u00F2'; case "ograve": return '\u00F2';
case "oacute,": return '\u00F3'; case "oacute": return '\u00F3';
case "ocirc,": return '\u00F4'; case "ocirc": return '\u00F4';
case "otilde,": return '\u00F5'; case "otilde": return '\u00F5';
case "ouml,": return '\u00F6'; case "ouml": return '\u00F6';
case "divide,": case "div": return '\u00F7'; case "divide": case "div": return '\u00F7';
case "oslash,": return '\u00F8'; case "oslash": return '\u00F8';
case "ugrave,": return '\u00F9'; case "ugrave": return '\u00F9';
case "uacute,": return '\u00FA'; case "uacute": return '\u00FA';
case "ucirc,": return '\u00FB'; case "ucirc": return '\u00FB';
case "uuml,": return '\u00FC'; case "uuml": return '\u00FC';
case "yacute,": return '\u00FD'; case "yacute": return '\u00FD';
case "thorn,": return '\u00FE'; case "thorn": return '\u00FE';
case "yuml,": return '\u00FF'; case "yuml": return '\u00FF';
case "Amacr": return '\u0100'; case "Amacr": return '\u0100';
case "amacr": return '\u0101'; case "amacr": return '\u0101';
case "Abreve": return '\u0102'; case "Abreve": return '\u0102';

11
jni.d
View File

@ -78,7 +78,7 @@
Exact details subject to change, especially of how I pass the exceptions over. Exact details subject to change, especially of how I pass the exceptions over.
Calling Java methods from D coming later. It is also possible to call Java methods and create Java objects from D with the `@Import` uda.
While you can write pretty ordinary looking D code, there's some things to keep in mind for safety and efficiency. While you can write pretty ordinary looking D code, there's some things to keep in mind for safety and efficiency.
@ -120,7 +120,14 @@
+/ +/
module arsd.jni; module arsd.jni;
// FIXME: in general i didn't handle overloads at all // FIXME: java.lang.CharSequence is the interface for String. We should support that just as well.
// FIXME: in general, handle substituting subclasses for interfaces nicely
// FIXME: solve the globalref/pin issue with the type system
//
// FIXME: in general i didn't handle overloads at all. Using RegisterNatives should make that doable... and I might be able to remove some of the pragma(mangle) that way too. And get more error checking done up-front.
// FIXME: what about the parent class of the java object? Best we can probably do is an interface but perhaps it could be auto-generated by the JavaClass magic. It could take the list and just copy the @Import items. // FIXME: what about the parent class of the java object? Best we can probably do is an interface but perhaps it could be auto-generated by the JavaClass magic. It could take the list and just copy the @Import items.