标签: syntax-error

为什么不{$ ifopt FINITEFLOAT ON}编译?

我有结构:

{$ifopt FINITEFLOAT ON}
  {$message 'FINITEFLOAT option ON' }
{$else }
  {$message 'FINITEFLOAT option OFF' }
{$endif }
Run Code Online (Sandbox Code Playgroud)

在我的源码,它将无法编译!它必须是愚蠢的东西.错误是:

E1030编译器指令无效:'$ IFOPT'

在第一线,但它是抱怨的FINITEFLOAT.除了像R +等单字母指令作为IFOPT的参数之外,您似乎无法指定任何内容.

我在这里错过了什么吗?

delphi syntax-error delphi-2006 compiler-options

7
推荐指数
1
解决办法
438
查看次数

使用"function(array $ matches)"时出现意外的T_FUNCTION错误

嗨我正在使用以下代码,但我得到第二行的"意外的T_FUNCTION"语法错误.有什么建议?

preg_replace_callback("/\\[LINK\=(.*?)\\\](.*?)\\[\/LINK\\]/is",
function (array $matches) {
    if (filter_var($matches[1], FILTER_VALIDATE_URL))
        return '<a href="'.
            htmlspecialchars($matches[1], ENT_QUOTES).
            '" target="_blank">'.
            htmlspecialchars($matches[2])."</a>";
    else
        return "INVALID MARKUP";
}, $text);
Run Code Online (Sandbox Code Playgroud)

php syntax-error

7
推荐指数
1
解决办法
3万
查看次数

未捕获的SyntaxError:意外的令牌变量

我有一个错误Uncaught SyntaxError:在(1)和(2)之间显示意外的令牌变量,这是一个非常奇怪的错误,它完全没有意义.

if ($hiddenimage.length==0) { //if this is the first time moving over or clicking on the anchor link
    var $hiddenimage=$('<img src="'+this.href+'" />').appendTo($hiddenimagediv) //populate hidden div with enlarged image
    $hiddenimage.bind('loadevt', function(e){ //when enlarged image has fully loaded
        loadarea.empty().append($.thumbnailviewer2.buildimage($, $anchor, s, options)
        (1) - var $targetimage=$.thumbnailviewer2.buildimage($, $anchor, s, options) //create reference actual enlarged image
        (2) - $loadarea.empty().append($targetimage) //show enlarged image
        $.thumbnailviewer2.showimage($targetimage, s)
    })
Run Code Online (Sandbox Code Playgroud)

javascript syntax-error

7
推荐指数
2
解决办法
7万
查看次数

语法错误:反引号替换中的EOF

我收到了一个错误Syntax error: EOF in backquote substitution,我没有最清楚的想法.有人会介意快速看一下吗?

#! /bin/sh
# chkconfig 345 85 60
# description: startup script for produtcrawler-router
# processname: producrawler-router

NAME=productcrawler-router
DIR=/etc/productcrawler/services
EXEC=router.py
PID_FILE=/var/run/productcrawler.pid
IEXE=/etc/init.d/productcrawler-router
RUN_AS=root

### BEGIN INIT INFO
# Provides:          productcrawler-router
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     5
# Default-Stop:      0 1 2 3 6
# Description:       Starts the productcrawler-router service
### END INIT INFO

if [ ! -f $DIR/$EXEC ]
then
        echo "$DIR/$EXEC not found."
        exit
fi

case "$1" …
Run Code Online (Sandbox Code Playgroud)

bash init.d syntax-error sh

7
推荐指数
1
解决办法
3万
查看次数

在大型PHP文件中找到缺少的大括号?

我正在调试客户端的 3500行PHP文件.包含这个文件会导致PHP Parse error: syntax error, unexpected $end in ...错误,所以我假设某个地方有一个缺失的括号.是否有一个简单的工具或方法可以在线或在我正在使用的Komodo IDE中丢失大括号发现?

php ide debugging syntax-error

7
推荐指数
1
解决办法
8936
查看次数

奇怪的意外T_STRING错误

我在当前的Symfony2项目中有一个奇怪的PHP错误:

unexpected T_STRING in /blahblah/Foo/BarBundle/Entity/User.php on line 1
Run Code Online (Sandbox Code Playgroud)

这是一个非常标准的错误,通常与一对不匹配的"或"相关联.

但这里是User.php文件的代码

<?php
namespace Foo\BarBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Entity
 * @ORM\Table(name="fos_user")
 * @ORM\Entity(repositoryClass="Foo\BarBundle\Entity\UserRepository")
 */
class User extends \FOS\UserBundle\Entity\User
{
    // classic user entity
Run Code Online (Sandbox Code Playgroud)

行<?php是第1行.没有引号,奇怪的是这个错误只出现在我的登台服务器上:在具有代码本地副本的2台开发机器上,它的行为符合预期,没有错误或警告.该文件是正确的,缓存已清空.我认为它可能是一个编码错误但它似乎不是这个.我也想过命名空间问题,但服务器上的PHP版本是正确的(5.3.16)

你知道这个错误可能源于什么,或者我可以搜索哪个方向?提前致谢.

php syntax-error symfony fosuserbundle

7
推荐指数
1
解决办法
1067
查看次数

jQuery脚本无法在Internet Explorer中运行(第1行char 1上的语法错误)

我正在为一个新项目开发一个响应式html模型,它包含一些jquery脚本,可以在每个浏览器上运行完美...除了Internet Explorer(我目前正在IE9上测试它).

我自然检查了IE的javascript控制台,它给出了以下错误消息:

SCRIPT1002: Syntax error 
scripts.js, line 1 character 1
Run Code Online (Sandbox Code Playgroud)

我完全不知道它可能来自哪里,因为DreamWeaver或Komodo Edit都没有发现任何错误.

该模型在以下地址在线:http://zipion-live.be/cal-bw/

这是导致错误的脚本:

const visible = "visible";
const hidden = "hidden";
const open = "open";

$(document).ready(function(e) {
    $(".collapsible_container .links").hide();
    showHomeMenu();

    $("#home_link").click(showHomeMenu);

    $("#admin_link").click(showAdminMenu);

    $("#left_menu .links a").click(function() {
        $("#left_menu .links").slideUp("fast");
        $("#left_menu .collapsible_container").removeClass(open);
    });

    $("section .section_header").click(function() {
        var sectionContent = $(this).parent("section").children(".section_content");
        var sectionHeader = $(this);
        toggleSection(sectionHeader, sectionContent);
    });
});

function toggleSection(sectionHeader, sectionContent) {
    var isOpen = sectionHeader.hasClass(open);

    if (isOpen) {
        sectionContent.slideUp("slow", function() {
            sectionHeader.removeClass(open);
        });
    } else {
        sectionContent.slideDown("slow");
        sectionHeader.addClass(open); …
Run Code Online (Sandbox Code Playgroud)

html javascript jquery internet-explorer syntax-error

7
推荐指数
1
解决办法
4096
查看次数

Java中的语法错误

if ( year % 4 == 0 )
    int i = 0;
else
    int j = 0;
Run Code Online (Sandbox Code Playgroud)

由于这行代码而在eclipse中出现的语法错误是:

  • 令牌"int"上的语法错误,删除此令牌
  • 我无法解决变量
  • 令牌"int"上的语法错误,删除此令牌
  • j无法解析为变量
  • 令牌"="上的语法错误,删除此令牌

我不知道为什么会这样.

从我观察到的情况来看,我认为在if else构造体中放置一个int声明正在实现它.

如果我在代码中更早地声明i和j并运行程序,则错误消失如下:

int i; int j;
if ( year % 4 == 0 )
    i = 0;
else
    j = 0;
Run Code Online (Sandbox Code Playgroud)

在这种情况下没有语法错误.为什么?

java syntax-error

7
推荐指数
1
解决办法
163
查看次数

angular2:Uncaught SyntaxError:意外的令牌<

Uncaught SyntaxError: Unexpected token <每当我尝试运行angular2应用程序时,我都会收到此错误.这只是基于angular2网站的路由"教程"的修改.

通常这些错误说明了我错误编写了一段代码.但是Chrome控制台告诉我在angular2 js文件中发生了错误.

阅读并试图从两者的答案Chrome Uncaught Syntax Error: Unexpected Token ILLEGAL ,并warning C4819: How to find the character that has to be saved in unicode?没有工作.猜测错误必须在我的boot.ts或app.component.ts中.

boot.ts

import {bootstrap}        from 'angular2/platform/browser';
import {ROUTER_PROVIDERS} from 'angular2/router';
import {AppComponent}     from './app.component';
import {HallService}     from './hall/hall.service';
bootstrap(AppComponent,[
    ROUTER_PROVIDERS,
    HallService
]);
Run Code Online (Sandbox Code Playgroud)

app.component.ts

import {Component} from 'angular2/core';
import {RouteConfig, ROUTER_DIRECTIVES} from 'angular2/router';
import {HallCenterComponent} from './hall/hall-center.component';

@Component({
    selector: 'my-app',
    template: `
    <h1 class="title">Component Router</h1>
    <a …
Run Code Online (Sandbox Code Playgroud)

javascript syntax-error token typescript angular

7
推荐指数
2
解决办法
3万
查看次数

"连续两个术语"错误

我正在尝试编写如下的紧凑行,代码是脚本的摘录,该脚本使用动态范围的特殊变量$*IN读取STDIN.你能告诉我如何正确写这条线吗?

这有效

for $*IN.lines() {
    last when "" ;
    say "VERBOSE \"$_ is the string\"";
    $i=$i+1;
}
Run Code Online (Sandbox Code Playgroud)

不起作用

.say "VERBOSE \"$_ is the string\"" for $*IN.lines() last when "";
Run Code Online (Sandbox Code Playgroud)

错误输出:

===SORRY!=== Error while compiling /usr/share/asterisk/agi-bin/agi-t1.p6
Two terms in a row
at /usr/share/asterisk/agi-bin/agi-t1.p6:5
------> .say? "Verbose \"$_\"" for $*IN.lines() last
expecting any of:
  infix
  infix stopper
  statement end
  statement modifier
  statement modifier loop
Run Code Online (Sandbox Code Playgroud)

compiler-errors syntax-error perl6

7
推荐指数
1
解决办法
135
查看次数