Skip to content

Commit

Permalink
🚚 Keep same file type name as vim
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed Feb 13, 2024
1 parent 462b479 commit 3dc99b7
Show file tree
Hide file tree
Showing 18 changed files with 93 additions and 90 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ string(REGEX MATCH [[[0-9](\.[0-9])*]] VERSION "$ENV{GITHUB_REF_NAME}")
if(NOT VERSION)
set(VERSION 0.0.0.0)
endif()
set(HOMEPAGE_URL https://github.com/Freed-Wu/tree-sitter-m3u)
string(REGEX REPLACE ".*/tree-sitter-([^/]*)$" "\\1" LANGUAGE ${HOMEPAGE_URL})
if("$ENV{GITHUB_REPOSITORY}")
set(HOMEPAGE_URL "https://github.com/$ENV{GITHUB_REPOSITORY}")
string(REGEX REPLACE ".*/tree-sitter-([^/]*)$" "\\1" LANGUAGE ${HOMEPAGE_URL})
else()
set(HOMEPAGE_URL "")
string(REGEX REPLACE ".*/tree-sitter-([^/]*)$" "\\1" LANGUAGE ${CMAKE_CURRENT_SOURCE_DIR})
endif()
project(
tree-sitter-${LANGUAGE}
VERSION ${VERSION}
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[package]
name = "tree-sitter-m3u"
description = "m3u grammar for the tree-sitter parsing library"
name = "tree-sitter-hlsplaylist"
description = "hlsplaylist grammar for the tree-sitter parsing library"
version = "0.0.1"
keywords = ["incremental", "parsing", "m3u"]
keywords = ["incremental", "parsing", "m3u", "m3u8"]
categories = ["parsing", "text-editors"]
repository = "https://github.com/Freed-Wu/tree-sitter-m3u"
repository = "https://github.com/Freed-Wu/tree-sitter-hlsplaylist"
edition = "2018"
license = "GPL-3.0-or-later"

Expand Down
82 changes: 39 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
# tree-sitter-m3u
# tree-sitter-hlsplaylist

[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Freed-Wu/tree-sitter-m3u/main.svg)](https://results.pre-commit.ci/latest/github/Freed-Wu/tree-sitter-m3u/main)
[![github/workflow](https://github.com/Freed-Wu/tree-sitter-m3u/actions/workflows/main.yml/badge.svg)](https://github.com/Freed-Wu/tree-sitter-m3u/actions)
[![codecov](https://codecov.io/gh/Freed-Wu/tree-sitter-m3u/branch/main/graph/badge.svg)](https://codecov.io/gh/Freed-Wu/tree-sitter-m3u)
[![DeepSource](https://deepsource.io/gh/Freed-Wu/tree-sitter-m3u.svg/?show_trend=true)](https://deepsource.io/gh/Freed-Wu/tree-sitter-m3u)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Freed-Wu/tree-sitter-hlsplaylist/main.svg)](https://results.pre-commit.ci/latest/github/Freed-Wu/tree-sitter-hlsplaylist/main)
[![github/workflow](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/actions/workflows/main.yml/badge.svg)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/actions)
[![codecov](https://codecov.io/gh/Freed-Wu/tree-sitter-hlsplaylist/branch/main/graph/badge.svg)](https://codecov.io/gh/Freed-Wu/tree-sitter-hlsplaylist)
[![DeepSource](https://deepsource.io/gh/Freed-Wu/tree-sitter-hlsplaylist.svg/?show_trend=true)](https://deepsource.io/gh/Freed-Wu/tree-sitter-hlsplaylist)

[![github/downloads](https://shields.io/github/downloads/Freed-Wu/tree-sitter-m3u/total)](https://github.com/Freed-Wu/tree-sitter-m3u/releases)
[![github/downloads/latest](https://shields.io/github/downloads/Freed-Wu/tree-sitter-m3u/latest/total)](https://github.com/Freed-Wu/tree-sitter-m3u/releases/latest)
[![github/issues](https://shields.io/github/issues/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u/issues)
[![github/issues-closed](https://shields.io/github/issues-closed/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u/issues?q=is%3Aissue+is%3Aclosed)
[![github/issues-pr](https://shields.io/github/issues-pr/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u/pulls)
[![github/issues-pr-closed](https://shields.io/github/issues-pr-closed/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u/pulls?q=is%3Apr+is%3Aclosed)
[![github/discussions](https://shields.io/github/discussions/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u/discussions)
[![github/milestones](https://shields.io/github/milestones/all/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u/milestones)
[![github/forks](https://shields.io/github/forks/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u/network/members)
[![github/stars](https://shields.io/github/stars/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u/stargazers)
[![github/watchers](https://shields.io/github/watchers/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u/watchers)
[![github/contributors](https://shields.io/github/contributors/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u/graphs/contributors)
[![github/commit-activity](https://shields.io/github/commit-activity/w/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u/graphs/commit-activity)
[![github/last-commit](https://shields.io/github/last-commit/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u/commits)
[![github/release-date](https://shields.io/github/release-date/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u/releases/latest)
[![github/downloads](https://shields.io/github/downloads/Freed-Wu/tree-sitter-hlsplaylist/total)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/releases)
[![github/downloads/latest](https://shields.io/github/downloads/Freed-Wu/tree-sitter-hlsplaylist/latest/total)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/releases/latest)
[![github/issues](https://shields.io/github/issues/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/issues)
[![github/issues-closed](https://shields.io/github/issues-closed/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/issues?q=is%3Aissue+is%3Aclosed)
[![github/issues-pr](https://shields.io/github/issues-pr/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/pulls)
[![github/issues-pr-closed](https://shields.io/github/issues-pr-closed/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/pulls?q=is%3Apr+is%3Aclosed)
[![github/discussions](https://shields.io/github/discussions/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/discussions)
[![github/milestones](https://shields.io/github/milestones/all/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/milestones)
[![github/forks](https://shields.io/github/forks/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/network/members)
[![github/stars](https://shields.io/github/stars/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/stargazers)
[![github/watchers](https://shields.io/github/watchers/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/watchers)
[![github/contributors](https://shields.io/github/contributors/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/graphs/contributors)
[![github/commit-activity](https://shields.io/github/commit-activity/w/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/graphs/commit-activity)
[![github/last-commit](https://shields.io/github/last-commit/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/commits)
[![github/release-date](https://shields.io/github/release-date/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/releases/latest)

[![github/license](https://shields.io/github/license/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u/blob/main/LICENSE)
[![github/languages](https://shields.io/github/languages/count/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u)
[![github/languages/top](https://shields.io/github/languages/top/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u)
[![github/directory-file-count](https://shields.io/github/directory-file-count/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u)
[![github/code-size](https://shields.io/github/languages/code-size/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u)
[![github/repo-size](https://shields.io/github/repo-size/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u)
[![github/v](https://shields.io/github/v/release/Freed-Wu/tree-sitter-m3u)](https://github.com/Freed-Wu/tree-sitter-m3u)
[![github/license](https://shields.io/github/license/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist/blob/main/LICENSE)
[![github/languages](https://shields.io/github/languages/count/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist)
[![github/languages/top](https://shields.io/github/languages/top/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist)
[![github/directory-file-count](https://shields.io/github/directory-file-count/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist)
[![github/code-size](https://shields.io/github/languages/code-size/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist)
[![github/repo-size](https://shields.io/github/repo-size/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist)
[![github/v](https://shields.io/github/v/release/Freed-Wu/tree-sitter-hlsplaylist)](https://github.com/Freed-Wu/tree-sitter-hlsplaylist)

[![pypi/status](https://shields.io/pypi/status/tree-sitter-m3u)](https://pypi.org/project/tree-sitter-m3u/#description)
[![pypi/v](https://shields.io/pypi/v/tree-sitter-m3u)](https://pypi.org/project/tree-sitter-m3u/#history)
[![pypi/downloads](https://shields.io/pypi/dd/tree-sitter-m3u)](https://pypi.org/project/tree-sitter-m3u/#files)
[![pypi/format](https://shields.io/pypi/format/tree-sitter-m3u)](https://pypi.org/project/tree-sitter-m3u/#files)
[![pypi/implementation](https://shields.io/pypi/implementation/tree-sitter-m3u)](https://pypi.org/project/tree-sitter-m3u/#files)
[![pypi/pyversions](https://shields.io/pypi/pyversions/tree-sitter-m3u)](https://pypi.org/project/tree-sitter-m3u/#files)
[![pypi/status](https://shields.io/pypi/status/tree-sitter-hlsplaylist)](https://pypi.org/project/tree-sitter-hlsplaylist/#description)
[![pypi/v](https://shields.io/pypi/v/tree-sitter-hlsplaylist)](https://pypi.org/project/tree-sitter-hlsplaylist/#history)
[![pypi/downloads](https://shields.io/pypi/dd/tree-sitter-hlsplaylist)](https://pypi.org/project/tree-sitter-hlsplaylist/#files)
[![pypi/format](https://shields.io/pypi/format/tree-sitter-hlsplaylist)](https://pypi.org/project/tree-sitter-hlsplaylist/#files)
[![pypi/implementation](https://shields.io/pypi/implementation/tree-sitter-hlsplaylist)](https://pypi.org/project/tree-sitter-hlsplaylist/#files)
[![pypi/pyversions](https://shields.io/pypi/pyversions/tree-sitter-hlsplaylist)](https://pypi.org/project/tree-sitter-hlsplaylist/#files)

[![npm](https://img.shields.io/npm/dw/tree-sitter-m3u)](https://www.npmjs.com/package/tree-sitter-m3u)
[![npm](https://img.shields.io/npm/dw/tree-sitter-hlsplaylist)](https://www.npmjs.com/package/tree-sitter-hlsplaylist)

[![Crates.io (recent)](https://img.shields.io/crates/dr/tree-sitter-m3u)](https://crates.io/crates/tree-sitter-m3u)
[![Crates.io (recent)](https://img.shields.io/crates/dr/tree-sitter-hlsplaylist)](https://crates.io/crates/tree-sitter-hlsplaylist)

[m3u(8)](https://datatracker.ietf.org/doc/html/rfc8216#page-10) grammar for
[hlsplaylist](https://developer.apple.com/streaming/) (m3u, m3u8) grammar for
[tree-sitter](https://github.com/tree-sitter/tree-sitter).

It can be used by:
Expand All @@ -64,15 +64,11 @@ It can be used by:
your `~/.config/tree-sitter/config.json`
- Language servers
- Libraries
- [tree-sitter-m3u](https://www.npmjs.com/package/tree-sitter-m3u):
- [tree-sitter-hlsplaylist](https://www.npmjs.com/package/tree-sitter-hlsplaylist):
for node
- [tree-sitter-m3u](https://crates.io/crates/tree-sitter-m3u):
- [tree-sitter-hlsplaylist](https://crates.io/crates/tree-sitter-hlsplaylist):
for rust
- [tree-sitter-m3u](https://pypi.org/project/tree-sitter-m3u):
- [tree-sitter-hlsplaylist](https://pypi.org/project/tree-sitter-hlsplaylist):
for python
- [tree-sitter-languages](https://github.com/grantjenks/py-tree-sitter-languages):
for python

## Related Projects

- [m3u.vim](https://github.com/Freed-Wu/m3u.vim): vim syntax
2 changes: 1 addition & 1 deletion binding.gyp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ # noqa: B018 # type: ignore
"targets": [
{
"target_name": "tree_sitter_m3u_binding",
"target_name": "tree_sitter_hlsplaylist_binding",
"include_dirs": ["<!(node -e \"require('nan')\")", "src"],
"sources": [
"bindings/node/binding.cc",
Expand Down
8 changes: 4 additions & 4 deletions bindings/node/binding.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

using namespace v8;

extern "C" TSLanguage * tree_sitter_m3u();
extern "C" TSLanguage * tree_sitter_hlsplaylist();

namespace {

Expand All @@ -17,12 +17,12 @@ void Init(Local<Object> exports, Local<Object> module) {

Local<Function> constructor = Nan::GetFunction(tpl).ToLocalChecked();
Local<Object> instance = constructor->NewInstance(Nan::GetCurrentContext()).ToLocalChecked();
Nan::SetInternalFieldPointer(instance, 0, tree_sitter_m3u());
Nan::SetInternalFieldPointer(instance, 0, tree_sitter_hlsplaylist());

Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("m3u").ToLocalChecked());
Nan::Set(instance, Nan::New("name").ToLocalChecked(), Nan::New("hlsplaylist").ToLocalChecked());
Nan::Set(module, Nan::New("exports").ToLocalChecked(), instance);
}

NODE_MODULE(tree_sitter_m3u_binding, Init)
NODE_MODULE(tree_sitter_hlsplaylist_binding, Init)

} // namespace
4 changes: 2 additions & 2 deletions bindings/node/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
try {
module.exports = require("../../build/Release/tree_sitter_m3u_binding");
module.exports = require("../../build/Release/tree_sitter_hlsplaylist_binding");
} catch (error1) {
if (error1.code !== 'MODULE_NOT_FOUND') {
throw error1;
}
try {
module.exports = require("../../build/Debug/tree_sitter_m3u_binding");
module.exports = require("../../build/Debug/tree_sitter_hlsplaylist_binding");
} catch (error2) {
if (error2.code !== 'MODULE_NOT_FOUND') {
throw error2;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions bindings/rust/lib.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! This crate provides m3u language support for the [tree-sitter][] parsing library.
//! This crate provides hlsplaylist language support for the [tree-sitter][] parsing library.
//!
//! Typically, you will use the [language][language func] function to add this language to a
//! tree-sitter [Parser][], and then use the parser to parse some code:
//!
//! ```
//! let code = "";
//! let mut parser = tree_sitter::Parser::new();
//! parser.set_language(tree_sitter_m3u::language()).expect("Error loading m3u grammar");
//! parser.set_language(tree_sitter_hlsplaylist::language()).expect("Error loading hlsplaylist grammar");
//! let tree = parser.parse(code, None).unwrap();
//! ```
//!
Expand All @@ -18,14 +18,14 @@
use tree_sitter::Language;

extern "C" {
fn tree_sitter_m3u() -> Language;
fn tree_sitter_hlsplaylist() -> Language;
}

/// Get the tree-sitter [Language][] for this grammar.
///
/// [Language]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Language.html
pub fn language() -> Language {
unsafe { tree_sitter_m3u() }
unsafe { tree_sitter_hlsplaylist() }
}

/// The content of the [`node-types.json`][] file for this grammar.
Expand All @@ -47,6 +47,6 @@ mod tests {
let mut parser = tree_sitter::Parser::new();
parser
.set_language(super::language())
.expect("Error loading m3u language");
.expect("Error loading hlsplaylist language");
}
}
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = grammar({
name: "m3u",
name: "hlsplaylist",

rules: {
file: ($) => repeat(seq(choice($.uri, $.comment, $.tag), $._eol)),
Expand Down
16 changes: 9 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "tree-sitter-m3u",
"version": "0.0.1",
"description": "m3u grammar for tree-sitter",
"name": "tree-sitter-hlsplaylist",
"version": "0.0.2",
"description": "hlsplaylist grammar for tree-sitter",
"main": "bindings/node",
"keywords": [
"parsing",
"incremental"
"incremental",
"m3u",
"m3u8"
],
"dependencies": {
"nan": "^2.12.1"
Expand All @@ -18,10 +20,10 @@
},
"tree-sitter": [
{
"scope": "source.m3u",
"scope": "source.hlsplaylist",
"file-types": [
"m3u",
"m3u8"
"hlsplaylist",
"hlsplaylist8"
]
}
]
Expand Down
18 changes: 9 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ requires = ["scikit-build-core"]
build-backend = "scikit_build_core.build"

[project]
name = "tree-sitter-m3u"
description = "m3u grammar for tree-sitter"
name = "tree-sitter-hlsplaylist"
description = "hlsplaylist grammar for tree-sitter"
readme = "README.md"
# sysconfig.get_preferred_scheme()
requires-python = ">= 3.10"
Expand Down Expand Up @@ -46,10 +46,10 @@ email = "wuzhenyu@ustc.edu"
text = "GPL v3"

[project.urls]
Homepage = "https://tree-sitter-m3u.readthedocs.io"
Download = "https://github.com/Freed-Wu/tree-sitter-m3u/releases"
"Bug Report" = "https://github.com/Freed-Wu/tree-sitter-m3u/issues"
Source = "https://github.com/Freed-Wu/tree-sitter-m3u"
Homepage = "https://tree-sitter-hlsplaylist.readthedocs.io"
Download = "https://github.com/Freed-Wu/tree-sitter-hlsplaylist/releases"
"Bug Report" = "https://github.com/Freed-Wu/tree-sitter-hlsplaylist/issues"
Source = "https://github.com/Freed-Wu/tree-sitter-hlsplaylist"

[tool.scikit-build]
experimental = true
Expand All @@ -58,10 +58,10 @@ experimental = true
provider = "scikit_build_core.metadata.setuptools_scm"

[tool.scikit-build.sdist]
include = ["bindings/python/tree_sitter_m3u/_version.py", "py.typed"]
include = ["bindings/python/tree_sitter_hlsplaylist/_version.py", "py.typed"]

[tool.scikit-build.wheel]
packages = ["bindings/python/tree_sitter_m3u"]
packages = ["bindings/python/tree_sitter_hlsplaylist"]

[tool.setuptools.dynamic.dependencies]
file = "requirements.txt"
Expand All @@ -72,7 +72,7 @@ file = "requirements/dev.txt"
# end: scripts/update-pyproject.toml.pl

[tool.setuptools_scm]
write_to = "bindings/python/tree_sitter_m3u/_version.py"
write_to = "bindings/python/tree_sitter_hlsplaylist/_version.py"

[tool.mdformat]
number = true
Expand Down
2 changes: 1 addition & 1 deletion src/grammar.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "m3u",
"name": "hlsplaylist",
"rules": {
"file": {
"type": "REPEAT",
Expand Down
2 changes: 1 addition & 1 deletion src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1898,7 +1898,7 @@ extern "C" {
#define extern __declspec(dllexport)
#endif

extern const TSLanguage *tree_sitter_m3u(void) {
extern const TSLanguage *tree_sitter_hlsplaylist(void) {
static const TSLanguage language = {
.version = LANGUAGE_VERSION,
.symbol_count = SYMBOL_COUNT,
Expand Down
8 changes: 4 additions & 4 deletions test/corpus/example.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ Example
#EXT-X-PLAYLIST-TYPE:EVENT
#EXT-X-PROGRAM-DATE-TIME:2024-02-11T15:30:30.500Z
#EXT-X-BYTERANGE:1@10
http://example.com/low/index.m3u8
http://example.com/low/index.hlsplaylist8

# https://iptv-org.github.io/iptv/languages/zho.m3u
# https://iptv-org.github.io/iptv/languages/zho.hlsplaylist
#EXTINF:-1 ,CCTV-2 (1080p)
http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226195/index.m3u8
http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221226195/index.hlsplaylist8
#EXTINF:-1 tvg-id="CCTV1.cn" tvg-logo="https://i.imgur.com/TpA3cUl.png" group-title="General",CCTV-1 (1080p)
http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221225804/index.m3u8
http://39.134.24.162/dbiptv.sn.chinamobile.com/PLTV/88888890/224/3221225804/index.hlsplaylist8

---

Expand Down
4 changes: 2 additions & 2 deletions tests/test___init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os

from tree_sitter_m3u import parser
from tree_sitter_hlsplaylist import parser


class Test:
Expand All @@ -15,7 +15,7 @@ def test_parser() -> None:
:rtype: None
"""
with open(
os.path.join(os.path.dirname(__file__), "zho.m3u"), "rb"
os.path.join(os.path.dirname(__file__), "zho.hlsplaylist"), "rb"
) as f:
text = f.read()
tree = parser.parse(text)
Expand Down
Loading

0 comments on commit 3dc99b7

Please sign in to comment.