mirror of https://github.com/Wilfred/difftastic/
Merge commit '5720b249490b3c17245ba772f6be4a43edb4e3b7'
commit
e24ca47173
@ -0,0 +1,33 @@
|
||||
name: Publish on crates.io
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
|
||||
env:
|
||||
CARGO_TERM_COLOR: always
|
||||
CARGO_INCREMENTAL: 0
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install Rust stable
|
||||
run: |
|
||||
rustup toolchain install stable --profile minimal --no-self-update
|
||||
|
||||
- name: Verify publish crate
|
||||
uses: katyo/publish-crates@v1
|
||||
with:
|
||||
dry-run: true
|
||||
|
||||
- name: Publish crate
|
||||
uses: katyo/publish-crates@v1
|
||||
with:
|
||||
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }}
|
||||
@ -0,0 +1,38 @@
|
||||
// swift-tools-version:5.3
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "TreeSitterJS",
|
||||
products: [
|
||||
.library(name: "TreeSitterJS", targets: ["TreeSitterJS"]),
|
||||
],
|
||||
dependencies: [],
|
||||
targets: [
|
||||
.target(name: "TreeSitterJS",
|
||||
path: ".",
|
||||
exclude: [
|
||||
"binding.gyp",
|
||||
"bindings",
|
||||
"Cargo.toml",
|
||||
"corpus",
|
||||
"grammar.js",
|
||||
"LICENSE",
|
||||
"Makefile",
|
||||
"package.json",
|
||||
"README.md",
|
||||
"script",
|
||||
"src/grammar.json",
|
||||
"src/node-types.json",
|
||||
"*.wasm",
|
||||
],
|
||||
sources: [
|
||||
"src/parser.c",
|
||||
"src/scanner.c",
|
||||
],
|
||||
resources: [
|
||||
.copy("queries")
|
||||
],
|
||||
publicHeadersPath: "bindings/swift",
|
||||
cSettings: [.headerSearchPath("src")])
|
||||
]
|
||||
)
|
||||
@ -0,0 +1,16 @@
|
||||
#ifndef TREE_SITTER_JAVASCRIPT_H_
|
||||
#define TREE_SITTER_JAVASCRIPT_H_
|
||||
|
||||
typedef struct TSLanguage TSLanguage;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern TSLanguage *tree_sitter_javascript();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // TREE_SITTER_JAVASCRIPT_H_
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,136 @@
|
||||
============================================
|
||||
Simple
|
||||
============================================
|
||||
|
||||
const Named = <template>
|
||||
{{ (doubled foo) }}
|
||||
</template>
|
||||
|
||||
----
|
||||
|
||||
(program
|
||||
(lexical_declaration
|
||||
(variable_declarator
|
||||
(identifier)
|
||||
(glimmer_template
|
||||
(glimmer_opening_tag)
|
||||
(glimmer_closing_tag)))))
|
||||
|
||||
|
||||
============================================
|
||||
Empty
|
||||
============================================
|
||||
|
||||
<template></template>
|
||||
|
||||
----
|
||||
|
||||
(program
|
||||
(expression_statement
|
||||
(glimmer_template
|
||||
(glimmer_opening_tag)
|
||||
(glimmer_closing_tag))))
|
||||
|
||||
|
||||
============================================
|
||||
Two Components
|
||||
============================================
|
||||
|
||||
const WithSemi = <template>
|
||||
{{ (doubled foo) }}
|
||||
</template>;
|
||||
|
||||
<template>
|
||||
<WithSemi />
|
||||
</template>;
|
||||
|
||||
----
|
||||
|
||||
(program
|
||||
(lexical_declaration
|
||||
(variable_declarator
|
||||
(identifier)
|
||||
(glimmer_template
|
||||
(glimmer_opening_tag)
|
||||
(glimmer_closing_tag))))
|
||||
|
||||
(expression_statement
|
||||
(glimmer_template
|
||||
(glimmer_opening_tag)
|
||||
(glimmer_closing_tag))))
|
||||
|
||||
============================================
|
||||
Multiple Assignment
|
||||
============================================
|
||||
|
||||
const Empty = <template></template>
|
||||
|
||||
const WithSemi = <template>
|
||||
<Empty />
|
||||
{{ (doubled foo) }}
|
||||
</template>;
|
||||
|
||||
|
||||
<template>
|
||||
<WithSemi />
|
||||
</template>;
|
||||
|
||||
----
|
||||
|
||||
(program
|
||||
(lexical_declaration
|
||||
(variable_declarator
|
||||
(identifier)
|
||||
(glimmer_template
|
||||
(glimmer_opening_tag)
|
||||
(glimmer_closing_tag))))
|
||||
|
||||
(lexical_declaration
|
||||
(variable_declarator
|
||||
(identifier)
|
||||
(glimmer_template
|
||||
(glimmer_opening_tag)
|
||||
(glimmer_closing_tag))))
|
||||
|
||||
(expression_statement
|
||||
(glimmer_template
|
||||
(glimmer_opening_tag)
|
||||
(glimmer_closing_tag))))
|
||||
|
||||
============================================
|
||||
Class Component
|
||||
============================================
|
||||
|
||||
class InClass {
|
||||
<template>
|
||||
{{this.whatever}}
|
||||
</template>
|
||||
}
|
||||
|
||||
----
|
||||
|
||||
(program
|
||||
(class_declaration
|
||||
(identifier)
|
||||
(class_body
|
||||
(glimmer_template
|
||||
(glimmer_opening_tag)
|
||||
(glimmer_closing_tag)))))
|
||||
|
||||
============================================
|
||||
JS Regex Evasion
|
||||
============================================
|
||||
|
||||
<template>
|
||||
{{#if true}}
|
||||
{{/if}}
|
||||
</template>
|
||||
|
||||
----
|
||||
|
||||
(program
|
||||
(expression_statement
|
||||
(glimmer_template
|
||||
(glimmer_opening_tag)
|
||||
(glimmer_closing_tag)
|
||||
)))
|
||||
@ -0,0 +1,43 @@
|
||||
============================================
|
||||
JSDoc
|
||||
============================================
|
||||
|
||||
/*
|
||||
* @return {void}
|
||||
*/
|
||||
function foo() {}
|
||||
|
||||
----
|
||||
|
||||
(program
|
||||
(comment)
|
||||
(function_declaration
|
||||
(identifier)
|
||||
(formal_parameters)
|
||||
(statement_block)))
|
||||
|
||||
============================================
|
||||
JSX
|
||||
============================================
|
||||
|
||||
const foo = 2;
|
||||
|
||||
<div>{{foo}}</div>
|
||||
|
||||
----
|
||||
|
||||
(program
|
||||
(lexical_declaration
|
||||
(variable_declarator
|
||||
(identifier)
|
||||
(number)))
|
||||
(expression_statement
|
||||
(jsx_element
|
||||
(jsx_opening_element
|
||||
(identifier))
|
||||
(jsx_expression
|
||||
(object
|
||||
(shorthand_property_identifier)))
|
||||
(jsx_closing_element
|
||||
(identifier)))))
|
||||
|
||||
Binary file not shown.
Loading…
Reference in New Issue