mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 20:38:47 +00:00
@@ -63,7 +63,8 @@ module Linguist
|
||||
generated_jni_header? ||
|
||||
composer_lock? ||
|
||||
node_modules? ||
|
||||
vcr_cassette?
|
||||
vcr_cassette? ||
|
||||
generated_by_zephir?
|
||||
end
|
||||
|
||||
# Internal: Is the blob an XCode project file?
|
||||
@@ -237,6 +238,13 @@ module Linguist
|
||||
!!name.match(/composer.lock/)
|
||||
end
|
||||
|
||||
# Internal: Is the blob a generated by Zephir
|
||||
#
|
||||
# Returns true or false.
|
||||
def generated_by_zephir?
|
||||
!!name.match(/.\.zep\.(?:c|h|php)$/)
|
||||
end
|
||||
|
||||
# Is the blob a VCR Cassette file?
|
||||
#
|
||||
# Returns true or false
|
||||
|
||||
@@ -757,10 +757,15 @@
|
||||
],
|
||||
"YAML": [
|
||||
".gemrc"
|
||||
],
|
||||
"Zephir": [
|
||||
"exception.zep.c",
|
||||
"exception.zep.h",
|
||||
"exception.zep.php"
|
||||
]
|
||||
},
|
||||
"tokens_total": 637178,
|
||||
"languages_total": 824,
|
||||
"tokens_total": 637237,
|
||||
"languages_total": 827,
|
||||
"tokens": {
|
||||
"ABAP": {
|
||||
"*/**": 1,
|
||||
@@ -68442,27 +68447,27 @@
|
||||
},
|
||||
"Zephir": {
|
||||
"%": 10,
|
||||
"{": 56,
|
||||
"{": 58,
|
||||
"#define": 1,
|
||||
"MAX_FACTOR": 3,
|
||||
"}": 50,
|
||||
"namespace": 3,
|
||||
"Test": 2,
|
||||
";": 86,
|
||||
"#include": 1,
|
||||
"}": 52,
|
||||
"namespace": 4,
|
||||
"Test": 4,
|
||||
";": 91,
|
||||
"#include": 9,
|
||||
"static": 1,
|
||||
"long": 3,
|
||||
"fibonacci": 4,
|
||||
"(": 55,
|
||||
"(": 59,
|
||||
"n": 5,
|
||||
")": 53,
|
||||
")": 57,
|
||||
"if": 39,
|
||||
"<": 1,
|
||||
"return": 25,
|
||||
"<": 2,
|
||||
"return": 26,
|
||||
"else": 11,
|
||||
"-": 25,
|
||||
"+": 5,
|
||||
"class": 2,
|
||||
"class": 3,
|
||||
"Cblock": 1,
|
||||
"public": 22,
|
||||
"function": 22,
|
||||
@@ -68470,7 +68475,29 @@
|
||||
"int": 3,
|
||||
"a": 6,
|
||||
"testCblock2": 1,
|
||||
"Router": 1,
|
||||
"#ifdef": 1,
|
||||
"HAVE_CONFIG_H": 1,
|
||||
"#endif": 1,
|
||||
"<php.h>": 1,
|
||||
"<Zend/zend_operators.h>": 1,
|
||||
"<Zend/zend_exceptions.h>": 1,
|
||||
"<Zend/zend_interfaces.h>": 1,
|
||||
"ZEPHIR_INIT_CLASS": 2,
|
||||
"Test_Router_Exception": 2,
|
||||
"ZEPHIR_REGISTER_CLASS_EX": 1,
|
||||
"Router": 3,
|
||||
"Exception": 4,
|
||||
"test": 1,
|
||||
"router_exception": 1,
|
||||
"zend_exception_get_default": 1,
|
||||
"TSRMLS_C": 1,
|
||||
"NULL": 1,
|
||||
"SUCCESS": 1,
|
||||
"extern": 1,
|
||||
"zend_class_entry": 1,
|
||||
"*test_router_exception_ce": 1,
|
||||
"php": 1,
|
||||
"extends": 1,
|
||||
"Route": 1,
|
||||
"protected": 9,
|
||||
"_pattern": 3,
|
||||
@@ -68549,7 +68576,6 @@
|
||||
"typeof": 2,
|
||||
"throw": 1,
|
||||
"new": 1,
|
||||
"Exception": 1,
|
||||
"explode": 1,
|
||||
"switch": 1,
|
||||
"count": 1,
|
||||
@@ -68824,7 +68850,7 @@
|
||||
"XSLT": 44,
|
||||
"Xtend": 399,
|
||||
"YAML": 77,
|
||||
"Zephir": 1026,
|
||||
"Zephir": 1085,
|
||||
"Zimpl": 123
|
||||
},
|
||||
"languages": {
|
||||
@@ -69018,8 +69044,8 @@
|
||||
"XSLT": 1,
|
||||
"Xtend": 2,
|
||||
"YAML": 2,
|
||||
"Zephir": 2,
|
||||
"Zephir": 5,
|
||||
"Zimpl": 1
|
||||
},
|
||||
"md5": "f4c480e7ebfd885f7fa0e842df3d4787"
|
||||
"md5": "c04de3d45a3b9a3f48347f9cb0603f09"
|
||||
}
|
||||
28
samples/Zephir/filenames/exception.zep.c
generated
Normal file
28
samples/Zephir/filenames/exception.zep.c
generated
Normal file
@@ -0,0 +1,28 @@
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "../../ext_config.h"
|
||||
#endif
|
||||
|
||||
#include <php.h>
|
||||
#include "../../php_ext.h"
|
||||
#include "../../ext.h"
|
||||
|
||||
#include <Zend/zend_operators.h>
|
||||
#include <Zend/zend_exceptions.h>
|
||||
#include <Zend/zend_interfaces.h>
|
||||
|
||||
#include "kernel/main.h"
|
||||
|
||||
|
||||
/**
|
||||
* Test\Router\Exception
|
||||
*
|
||||
* Exceptions generated by the router
|
||||
*/
|
||||
ZEPHIR_INIT_CLASS(Test_Router_Exception) {
|
||||
|
||||
ZEPHIR_REGISTER_CLASS_EX(Test\\Router, Exception, test, router_exception, zend_exception_get_default(TSRMLS_C), NULL, 0);
|
||||
|
||||
return SUCCESS;
|
||||
|
||||
}
|
||||
4
samples/Zephir/filenames/exception.zep.h
generated
Normal file
4
samples/Zephir/filenames/exception.zep.h
generated
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
extern zend_class_entry *test_router_exception_ce;
|
||||
|
||||
ZEPHIR_INIT_CLASS(Test_Router_Exception);
|
||||
8
samples/Zephir/filenames/exception.zep.php
generated
Normal file
8
samples/Zephir/filenames/exception.zep.php
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Test\Router;
|
||||
|
||||
class Exception extends \Exception
|
||||
{
|
||||
|
||||
}
|
||||
@@ -247,6 +247,13 @@ class TestBlob < Test::Unit::TestCase
|
||||
# Generated VCR
|
||||
assert blob("YAML/vcr_cassette.yml").generated?
|
||||
|
||||
# Generated by Zephir
|
||||
assert blob("Zephir/filenames/exception.zep.c").generated?
|
||||
assert blob("Zephir/filenames/exception.zep.h").generated?
|
||||
assert blob("Zephir/filenames/exception.zep.php").generated?
|
||||
assert !blob("Zephir/Router.zep").generated?
|
||||
|
||||
|
||||
assert Linguist::Generated.generated?("node_modules/grunt/lib/grunt.js", nil)
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user