summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibIDL
AgeCommit message (Collapse)Author
2023-03-24Libraries: Convert `DeprecatedFile` usages to `LibFileSystem`Cameron Youell
2023-03-23LibIDL: Add Type::is_json which says if the type is convertible to JSONLuke Wilde
2023-03-23LibIDL: Parse extended attributes for constructorsSrikavin Ramkumar
2023-03-21Everywhere: Use `LibFileSystem` where trivialCameron Youell
2023-03-16LibIDL: Partially implement distinguishing between interface-like typesTimothy Flynn
This is needed for WebAssembly, where we need to distinguish between a BufferSource and a WebAssembly.Module.
2023-03-16LibIDL+LibWeb: Begin supporting the LegacyNamespace extended attributeTimothy Flynn
This is used by WebAssembly IDL files. For now, we mostly use this for error messages and cache keys (to ensure compatibility with existing code as WebAssembly is ported to IDL).
2023-03-16LibIDL: Allow extended attributes on non-required IDL dictionary membersTimothy Flynn
For example, WebAssembly.Memory will have: [EnforceRange] unsigned long maximum;
2023-03-15LibIDL: Begin parsing IDL namespacesTimothy Flynn
For example, the CSS namespace is defined via IDL, but we currently have a manual implementation.
2023-03-10Everywhere: Rename equals_ignoring_case => equals_ignoring_ascii_caseAndreas Kling
Let's make it clear that these functions deal with ASCII case only.
2023-03-07LibWeb: Support interfaces with the [Global] extended attributeLinus Groh
These are treated differently as the interface members are placed on the object itself, not its prototype. As the object itself still needs to be hand-written code, and we can no longer fully hide the gnarly generated code in the prototype object, these now generate a 'mixin' class that is added to the actual object through inheritance. https://webidl.spec.whatwg.org/#Global
2023-03-06Everywhere: Remove NonnullRefPtr.h includesAndreas Kling
2023-03-06Everywhere: Stop using NonnullRefPtrVectorAndreas Kling
This class had slightly confusing semantics and the added weirdness doesn't seem worth it just so we can say "." instead of "->" when iterating over a vector of NNRPs. This patch replaces NonnullRefPtrVector<T> with Vector<NNRP<T>>.
2023-03-05LibIDL: Also parse extended attributes after 'optional'Linus Groh
From the WebIDL grammar: (https://webidl.spec.whatwg.org/#prod-Argument) Argument :: ExtendedAttributeList ArgumentRest ArgumentRest :: optional TypeWithExtendedAttributes ArgumentName Default TypeWithExtendedAttributes :: ExtendedAttributeList Type One IDL file has been updated to match the spec literally, as it can now be parsed properly.
2023-03-03LibIDL: Use OrderedHash{Table,Map} to store Enumeration valuesLinus Groh
Seems nice to keep these in the same order as the input and have deterministic codegen of interfaces in LibWeb (for the purpose of diffing two build revisions, for example).
2023-02-21LibWeb+LibIDL: Fix (or paper over) various const-correctness issuesAndreas Kling
There's definitely stuff to iterate on here, but this takes care of making the libraries compile with stricter RP and NNRP.
2023-02-13LibCore: Remove `Stream.h`Tim Schumacher
2023-02-13LibCore: Move Stream-based file into the `Core` namespaceTim Schumacher
2023-02-13LibCore: Rename `File` to `DeprecatedFile`Tim Schumacher
As usual, this removes many unused includes and moves used includes further down the chain.
2023-01-27AK: Remove StringBuilder::build() in favor of to_deprecated_string()Linus Groh
Having an alias function that only wraps another one is silly, and keeping the more obvious name should flush out more uses of deprecated strings. No behavior change.
2022-12-14LibIDL: Use `Core::Stream` to read importsTim Schumacher
2022-12-13BindingsGenerator+CMake: Keep track of IDL dependenciesDaniel Bertalan
This commit teaches BindingsGenerator to generate depfiles, which can be used by CMake to ensure that bindings are properly regenerated when imported IDL files change. Two new options, `--depfile` and `--depfile-target` are added. - `--depfile` sets the path for the dependency file. - `--depfile-target` lets us set a target name different than the output file in the depfile. This option is needed because generated files are first written to a temporary file, but depfiles have to refer to the final location. These are analogous to GCC's `-MF` and `-MT` options respectively. The depfile's syntax matches the ones generated by GCC. Note: This changes the minimal required CMake version to 3.20 if the Make generator is used, and to 3.21 for the Xcode generator. Ninja is not affected.
2022-12-06Everywhere: Rename to_{string => deprecated_string}() where applicableLinus Groh
This will make it easier to support both string types at the same time while we convert code, and tracking down remaining uses. One big exception is Value::to_string() in LibJS, where the name is dictated by the ToString AO.
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-11-30LibIDL: Fix bug where entire EffectiveOverloadSet was erasedAndreas Kling
There was a funny bug here: by storing the "last matched item" as a pointer, and then using Vector::remove_all_matching() to remove all items that didn't have that exact address, we would end up removing everything unless the last item matched was the very first item. (This happened because every time an item was removed from the vector, the remaining contents shift one step towards the start of the vector, affecting item addresses.) This patch fixes the issue by storing the last match as an index.
2022-11-19Everywhere: Remove unnecessary mutable attributes from lambdasMacDue
These lambdas were marked mutable as they captured a Ptr wrapper class by value, which then only returned const-qualified references to the value they point from the previous const pointer operators. Nothing is actually mutating in the lambdas state here, and now that the Ptr operators don't add extra const qualifiers these can be removed.
2022-11-10LibIDL: Also handle anonymous union types in resolve_typedef()Linus Groh
Even if the type doesn't have a name and won't yield a result when looking for it in interface.typedefs, we still need to look at each of the union's members and resolve those as well, in a similar fashion to how we already recursively resolve the replaced type. This is commonly used in function parameters, for example send() from the XMLHttpRequest interface: send(optional (Document or XMLHttpRequestBodyInit)? body = null)
2022-11-10LibIDL: Fix accidental early return in resolve_typedef()Linus Groh
This made sense before we had the next step to resolve union types, but now we only need to skip transferring the extended attributes, without returning just yet.
2022-11-10LibIDL: Use Type::as_foo() shortcuts in resolve_typedef()Linus Groh
2022-11-01Everywhere: Mark dependencies of most targets as PRIVATETim Schumacher
Otherwise, we end up propagating those dependencies into targets that link against that library, which creates unnecessary link-time dependencies. Also included are changes to readd now missing dependencies to tools that actually need them.
2022-10-21LibIDL: Resolve typedefs in UnionType members recursivelyLinus Groh
2022-10-09LibIDL: Remove static maps for interfaces and resolved importsAndrew Kaster
Instead, create a tree of Parsers all pointing to a top-level Parser. All module imports and interfaces are stored at the top level, instead of in a static map. This allows creating multiple IDL::Parsers in the same process without them stepping on each others toes.
2022-10-09LibIDL: Parse extended attributes that have () wrapped expressionsAndrew Kaster
This includes things like Exposed and LegacyFactoryFunction.
2022-10-06BindingsGenerator+LibIDL: Parse "inherit" attributesSam Atkins
An "inherit attribute" calls an ancestor's getter with the same name, but defines its own setter. Since a parent class's public methods are exposed to child classes, we don't have to do any special handling here to call the parent's methods, it just works. :^)
2022-09-21LibIDL+LibWeb: Remove stale references to "wrapper class" conceptLinus Groh
There are no wrappers for the platform object types anymore :^)
2022-09-17LibIDL: Implement EffectiveOverloadSetSam Atkins
This requires a little explanation. The overload resolution algorithm, where this is used, repeatedly has steps like this: > Otherwise: if V is a platform object, and there is an entry in S that > has one of the following types at position i of its type list, > - an interface type that V implements > - object > - a nullable version of any of the above types > - an annotated type whose inner type is one of the above types > - a union type, nullable union type, or annotated union type that has > one of the above types in its flattened member types > then remove from S all other entries. So, the API here tries to match that. We save the matching entry when checking through them and then use that in `remove_all_other_entries()`. Removing all those entries when all we actually care about is looking at that one matching entry feels silly, but sticking to the spec is more important while things are still half-implemented. :^)
2022-09-17LibIDL+WrapperGenerator: Implement Type::is_distinguishable_from()Sam Atkins
As part of this, I've moved a couple of methods for checking for null/undefined from UnionType to Type, and filled in more of their steps. This now detects more, and so causes us to hit a `TODO()` which is too big for me to go after right now, so I've replaced that assertion with a log message.
2022-09-17LibIDL+WrapperGenerator: Make it easier to work with IDL::Type classesSam Atkins
Track the kind of Type it is, and use that to provide some convenient `is_foo()` / `as_foo()` methods. While I was at it, made these all classes instead of structs and made their data private.
2022-09-17LibIDL+WrapperGenerator: Move IDL code into a librarySam Atkins
IDL function overload resolution requires knowing each IDL function's parameters and their types at runtime. The simplest way to do that is just to make the types the generator uses available to the runtime. Parsing has moved to LibIDL, but code generation has not, since that is very specific to WrapperGenerator.