You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I didn't realize the differences were so small. It looks like a few things need to be fixed/consolidated and then I think Zephir could simply be very similar to the way Arduino lays extra keywords down on top of C++. IE, Zephir becomes just PHP + extra keywords.
The current diff:
--- src/languages/php.js 2020-01-31 08:28:57.000000000 -0500+++ src/languages/zephir.js 2020-01-31 08:28:54.000000000 -0500@@ -1,21 +1,14 @@
<snip>
function(hljs) {
- var VARIABLE = {- begin: '\\$+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*'- };- var PREPROCESSOR = {- className: 'meta', begin: /<\?(php)?|\?>/- };
var STRING = {
className: 'string',
- contains: [hljs.BACKSLASH_ESCAPE, PREPROCESSOR],+ contains: [hljs.BACKSLASH_ESCAPE],
variants: [
{
begin: 'b"', end: '"'
@@ -29,20 +22,21 @@
};
var NUMBER = {variants: [hljs.BINARY_NUMBER_MODE, hljs.C_NUMBER_MODE]};
return {
- aliases: ['php', 'php3', 'php4', 'php5', 'php6', 'php7'],+ aliases: ['zep'],
case_insensitive: true,
keywords:
'and include_once list abstract global private echo interface as static endswitch ' +
- 'array null if endwhile or const for endforeach self var while isset public ' ++ 'array null if endwhile or const for endforeach self var let while isset public ' +
'protected exit foreach throw elseif include __FILE__ empty require_once do xor ' +
'return parent clone use __CLASS__ __LINE__ else break print eval new ' +
'catch __METHOD__ case exception default die require __FUNCTION__ ' +
'enddeclare final try switch continue endfor endif declare unset true false ' +
'trait goto instanceof insteadof __DIR__ __NAMESPACE__ ' +
- 'yield finally',+ 'yield finally int uint long ulong char uchar double float bool boolean string' ++ 'likely unlikely',
contains: [
+ hljs.C_LINE_COMMENT_MODE,
hljs.HASH_COMMENT_MODE,
- hljs.COMMENT('//', '$', {contains: [PREPROCESSOR]}),
hljs.COMMENT(
'/\\*',
'\\*/',
@@ -66,23 +60,9 @@
),
{
className: 'string',
- begin: /<<<['"]?\w+['"]?$/, end: /^\w+;?$/,- contains: [- hljs.BACKSLASH_ESCAPE,- {- className: 'subst',- variants: [- {begin: /\$\w+/},- {begin: /\{\$/, end: /\}/}- ]- }- ]- },- PREPROCESSOR,- {- className: 'keyword', begin: /\$this\b/+ begin: '<<<[\'"]?\\w+[\'"]?$', end: '^\\w+;',+ contains: [hljs.BACKSLASH_ESCAPE]
},
- VARIABLE,
{
// swallow composed identifiers to avoid parsing them as keywords
begin: /(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/
@@ -98,7 +78,6 @@
begin: '\\(', end: '\\)',
contains: [
'self',
- VARIABLE,
hljs.C_BLOCK_COMMENT_MODE,
STRING,
NUMBER
The text was updated successfully, but these errors were encountered:
It seems to me that Arduino is C++ with some additional functions. But it looks like Zephir is not an extension to PHP but a separate language. Yes, it looks a lot like PHP, and probably we can handle it as a superset to PHP. My only concern is that it may prove more complex to maintain Zefir if the language will change. I'm not sure it is very stable.
Context:
#2372
I didn't realize the differences were so small. It looks like a few things need to be fixed/consolidated and then I think Zephir could simply be very similar to the way Arduino lays extra keywords down on top of C++. IE, Zephir becomes just PHP + extra keywords.
The current diff:
The text was updated successfully, but these errors were encountered: