parse-error

ANTLR best practice for finding and catching parse errors

若如初见. 提交于 2021-02-11 15:05:38
问题 This question concerns how to get error messages out of an ANTLR4 parser in C# in Visual Studio. I feed the ANTLR parser a known bad input string, but I am not seeing any errors or parse exceptions thrown during the (bad) parse. Thus, my exception handler does not get a chance to create and store any error messages during the parse. I am working with an ANTLR4 grammar that I know to be correct because I can see correct parse operation outputs in graphical form with an ANTLR extension to

Making a graphQL mutation from my python code, getting error

◇◆丶佛笑我妖孽 提交于 2020-08-01 19:03:43
问题 I am trying to make a mutation to my Shopify store from python. I am new to graphQL, I have been able to make the mutation using graphiQL but I am not certain how to do it directly from my code. This is my make query file, it has worked successfully for a simple query `import requests def make_query(self, query, url, headers): """ Return query response """ request = requests.post(url, json={'query': query}, headers=headers) if request.status_code == 200: return request.json() else: raise

Reading bad csv files with garbage values

偶尔善良 提交于 2020-01-23 13:28:45
问题 I wish to read a csv file which has the following format using pandas: atrrth sfkjbgksjg airuqghlerig Name Roll airuqgorqowi awlrkgjabgwl AAA 67 BBB 55 CCC 07 As you can see, if I use pd.read_csv , I get the fairly obvious error: ParserError: Error tokenizing data. C error: Expected 1 fields in line 4, saw 2 But I wish to get the entire data into a dataframe. Using error_bad_lines = False will remove the important stuff and leave only the garbage values These are the 2 of the possible column

Reading bad csv files with garbage values

十年热恋 提交于 2020-01-23 13:28:25
问题 I wish to read a csv file which has the following format using pandas: atrrth sfkjbgksjg airuqghlerig Name Roll airuqgorqowi awlrkgjabgwl AAA 67 BBB 55 CCC 07 As you can see, if I use pd.read_csv , I get the fairly obvious error: ParserError: Error tokenizing data. C error: Expected 1 fields in line 4, saw 2 But I wish to get the entire data into a dataframe. Using error_bad_lines = False will remove the important stuff and leave only the garbage values These are the 2 of the possible column

json_encode creating a malformed JSON (with extra hidden character)

浪尽此生 提交于 2020-01-10 02:02:50
问题 I'm using PHP's json_encode() to return some data, retrieved by jQuery's ajax() : Simplified JS: $.ajax({ dataType: 'json', contentType: 'application/json', cache: false, type: 'POST', url: './api/_imgdown.php', error: function(jqXHR, textStatus, errorThrow) { console.log(jqXHR, textStatus, errorThrow); }, success: function(data, textStatus, jqXHR) { console.log(data, textStatus, jqXHR); } }); The PHP is: header('Content-Type: application/json; charset=UTF-8'); //default apiResponse

Strange parse error with static concatenated string variable [closed]

泄露秘密 提交于 2020-01-03 13:31:14
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . I'm getting this error: Parse error: syntax error, unexpected '.', expecting ',' or ';' in /var/(...)/config.php on line 5 With this (simplified) code: <

Haskell: parse error on input 'putStrLn'

允我心安 提交于 2020-01-03 01:55:11
问题 I just wrote my first Haskell program, but there is an error that I cannot understand. I think it is right because I just wrote it like the example from a book. Could anyone help me please? main = do putStrLn "Hello, what's your name?" name <- getLine putStrLn ("Hey" ++ name ++ ", nice to meet you!") The error message is: parse error on input 'putStrLn' It is strange. 回答1: Though it's impossible to tell from your posted code because SO converts tabs to spaces at least some of the time, the

Displaying strtotime() effectively in MySQL/PHP query

落爺英雄遲暮 提交于 2019-12-31 03:51:05
问题 This is my PHP/MySQL query, as mentioned at Displaying links in PHP/MySQL?: http://pastebin.com/5Td9Bybn I'll admit, I've forgotten how to use the strtotime() function effectively, as I want to show my show times in this format: 06:00 10:00 (without the :00 at the end, e.g. 10:00:00) The code displays this error now: Parse error: syntax error, unexpected T_ECHO in C:\www\vhosts\localradio\schedsun.php on line 11 I've fixed the errors in the previous question, how could I adapt this if I

Parse error: syntax error, unexpected '{', expecting '(' help?

↘锁芯ラ 提交于 2019-12-25 12:48:12
问题 I'm trying to make a photo gallery plugin for express engine, yet it's giving me this error and everything seems to close. Any help? $whats_gonna_happen=$_GET['pictures']; class upload_pictures { public function upload_pictures { if (!isset($whats_gonna_happen)) { $uploads=''; $cout=1; $stuff=$this->EE->db->query('SELECT id, name FROM albums'); $albums_list=''; while ($row=$stuff->result_array()) { $albums_list .= "<option value=" . $row[0] . ">" . $row[1] . "</option>\n"; } mysql_free_result