Team Ai
Datasetpublic

Brunobkr/llama.cpp_AlgMor24_github

ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes3.1kdownloads
README.md168 linesDownload Raw Back to oxc-parser
1# Oxc Parser2 3See [usage instructions](https://oxc.rs/docs/guide/usage/parser).4 5## Features6 7### Supports WASM8 9See https://stackblitz.com/edit/oxc-parser for usage example.10 11### ESTree12 13When parsing JS or JSX files, the AST returned is fully conformant with the14[ESTree standard](https://github.com/estree/estree), the same as produced by15[Acorn](https://npmx.dev/package/acorn).16 17When parsing TypeScript, the AST conforms to [@typescript-eslint/typescript-estree](https://npmx.dev/package/@typescript-eslint/typescript-estree)'s TS-ESTree format.18 19If you need all ASTs in the same with-TS-properties format, use the `astType: 'ts'` option.20 21The only differences between Oxc's AST and ESTree / TS-ESTree are:22 23- Support for Stage 3 [decorators](https://github.com/tc39/proposal-decorators).24- Support for Stage 3 ECMA features [`import defer`](https://github.com/tc39/proposal-defer-import-eval)25  and [`import source`](https://github.com/tc39/proposal-source-phase-imports).26- In TS-ESTree AST, `import.defer(...)` and `import.source(...)` are represented as an `ImportExpression`27  with `'defer'` or `'source'` in `phase` field (as in ESTree spec), where TS-ESLint represents these28  as a `CallExpression` with `MetaProperty` as its `callee`.29- Addition of a non-standard `hashbang` field to `Program`.30 31That aside, the AST should completely align with Acorn's ESTree AST or TS-ESLint's TS-ESTree.32Any deviation would be considered a bug.33 34### AST Types35 36[@oxc-project/types](https://npmx.dev/package/@oxc-project/types) can be used. For example:37 38```typescript39import { Statement } from "@oxc-project/types";40```41 42### Visitor43 44An AST visitor is provided. See example below.45 46This package also exports visitor keys which can be used with any other ESTree walker.47 48```js49import { visitorKeys } from "oxc-parser";50```51 52### Fast Mode53 54By default, Oxc parser does not produce semantic errors where symbols and scopes are needed.55 56To enable semantic errors, apply the option `showSemanticErrors: true`.57 58For example,59 60```js61let foo;62let foo;63```64 65Does not produce any errors when `showSemanticErrors` is `false`, which is the default behavior.66 67Fast mode is best suited for parser plugins, where other parts of your build pipeline has already checked for errors.68 69Please note that turning off fast mode ​incurs​ a small performance overhead.70 71### Returns ESM information.72 73It is likely that you are writing a parser plugin that requires ESM information.74 75To avoid walking the AST again, Oxc Parser returns ESM information directly.76 77This information can be used to rewrite import and exports with the help of [`magic-string`](https://npmx.dev/package/magic-string),78without any AST manipulations.79 80```ts81export interface EcmaScriptModule {82  /**83   * Has ESM syntax.84   *85   * i.e. `import` and `export` statements, and `import.meta`.86   *87   * Dynamic imports `import('foo')` are ignored since they can be used in non-ESM files.88   */89  hasModuleSyntax: boolean;90  /** Import statements */91  staticImports: Array<StaticImport>;92  /** Export statements */93  staticExports: Array<StaticExport>;94  /** Dynamic import expressions */95  dynamicImports: Array<DynamicImport>;96  /** Span positions of `import.meta` */97  importMetas: Array<Span>;98}99```100 101## API102 103### Functions104 105```typescript106// Synchronous parsing107parseSync(filename: string, sourceText: string, options?: ParserOptions): ParseResult108 109// Asynchronous parsing110parse(filename: string, sourceText: string, options?: ParserOptions): Promise<ParseResult>111```112 113Use `parseSync` for synchronous parsing. Use `parse` for asynchronous parsing, which can be beneficial in I/O-bound or concurrent scenarios, though it adds async overhead.114 115### Example116 117```javascript118import { parseSync, Visitor } from "oxc-parser";119 120const code = "const url: String = /* 🤨 */ import.meta.url;";121 122// File extension is used to determine which dialect to parse source as.123const filename = "test.tsx";124 125const result = parseSync(filename, code);126// Or use async version: const result = await parse(filename, code);127 128// An array of errors, if any.129console.log(result.errors);130 131// AST and comments.132console.log(result.program, result.comments);133 134// ESM information - imports, exports, `import.meta`s.135console.log(result.module);136 137// Visit the AST138const visitations = [];139 140const visitor = new Visitor({141  VariableDeclaration(decl) {142    visitations.push(`enter ${decl.kind}`);143  },144  "VariableDeclaration:exit"(decl) {145    visitations.push(`exit ${decl.kind}`);146  },147  Identifier(ident) {148    visitations.push(ident.name);149  },150});151 152visitor.visit(result.program);153 154// Logs: [ 'enter const', 'url', 'String', 'import', 'meta', 'url', 'exit const' ]155console.log(visitations);156```157 158### Options159 160All options are optional.161 162- `lang`: `'js'` | `'jsx'` | `'ts'` | `'tsx'`. Set language of source. If omitted, language is deduced from file extension.163- `sourceType`: `'script'` | `'module'` | `'unambiguous'`. Set source type. Defaults to `'module'`.164- `astType`: `'js'` | `'ts'`. Set to `'ts'` if you want ASTs of plain JS/JSX files to contain TypeScript-specific properties.165- `range`: `true` | `false`. If `true`, AST nodes contain a `range` field. Defaults to `false`.166- `preserveParens`: `true` | `false`. If `true`, parenthesized expressions are represented by (non-standard) `ParenthesizedExpression` and `TSParenthesizedType` AST nodes. Defaults to `true`.167- `showSemanticErrors`: `true` | `false`. If `true`, check file for semantic errors which parser does not otherwise emit e.g. `let x; let x;`. Has a small performance cost. Defaults to `false`.168 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai