Questions tagged [parsing]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
19 views

Haskell Interactive mode - incorrect parsing of crammed code

When using list comprehension without white spaces, all text after vertical bar turns grey. [x| is treated like header of here-document - grey color spans for the rest of the buffer, unless sequence |...
Przemek's user avatar
  • 101
1 vote
1 answer
109 views

Add parsing of latex-style .el file to LaTeX-hook using AUCTeX

I did some online research (e.g. here) but couldn't figure out how to solve the following problem so far (of course, I might have overlooked something since the whole emacs community is new to me). ...
lukeflo's user avatar
  • 195
0 votes
1 answer
110 views

JSON parsing fails: json-parse-error "too big integer"

I'm trying to parse a JSON file which contains large numbers: { "uuid": "c73b470a-5efb-4d53-9ac6-c5f6487f227b", "description": "grains on square 64&...
fap's user avatar
  • 141
0 votes
0 answers
33 views

org-element : remove first headline with its drawer

I have a org-element AST of a subtree which I want to make into a separate file. It looks necessarily like (org-data nil (headline (...metadata...) ; (a) (...
B. Pillet's user avatar
1 vote
1 answer
88 views

Lisp function to parse shebang line?

Before I probably re-invent the wheel, has anyone written a function (or perhaps there's one somewhere in Emacs already) to parse the shebang line of the current buffer (or some specified buffer). For ...
Ed Sabol's user avatar
  • 141
3 votes
1 answer
164 views

How can I make `forward-sexp` handle other balanced character-pairs such as < and > or << and >>?

I am trying to find an easy and efficient way to modify the behaviour of forward-sexp to handle balanced pairs of characters not normally supported by it, such as balanced < and > and balanced &...
PRouleau's user avatar
  • 796
1 vote
0 answers
278 views

How can I convert an inline pseudo YAML dictionary to a valid multiline one?

Consider this code: - name: Cron set up cron: name=something something="anything" job="/bin/bash -c 'service=nslcd; [[ -x /usr/bin/$service ]] && systemctl restart $service'&...
Kepi's user avatar
  • 259
3 votes
2 answers
461 views

Check whether a string is a date in a specific format, e.g. "%Y-%m-%d"

I have a string and would like to check whether it contains a date in a given date format, e.g. "%Y-%m-%d", with format as for format-time-string. This is for a package and users can configure the ...
tmalsburg's user avatar
  • 2,570
2 votes
2 answers
196 views

Can syntax parsing recognize the SQL '' (escape apostrophe/single quote) construct within SQL strings?

I am trying to enhance SQL mode such that editing of files of SQL code becomes more convenient, especially as far as jumping around is concerned (e.g. things like sql-goto-end-of-string etc.). I have ...
fsavigny's user avatar
5 votes
2 answers
100 views

What is a good strategy to locating function arguments in a buffer?

I'd like to create a few routines for manipulating function arguments in buffers, which of course requires me to first locate the arguments. Suppose that I'm operating on a buffer with a programming ...
dpritch's user avatar
  • 445
2 votes
3 answers
715 views

Split command line into a list of arguments

How do I take a string giving a shell command line such as: "program arg1 arg2 \"long argument with spaces\" arg\\\"3" and turn it into a list of unquoted arguments like: ("program" "arg1" "arg2" "...
Lassi's user avatar
  • 377
4 votes
5 answers
502 views

find end of string constant

I'm using a simple (re-search-forward "\"") to find the end of string constants in my buffer. This is to copy the string in a def like (defconst name1 "some string"). The problem is that string ...
phs's user avatar
  • 1,227
8 votes
3 answers
332 views

Split a complicated string?

Q: how do I split a complicated string when whitespace delimiters aren't discriminating enough? Background I'm working with BibTeX files. I want to split an author string of the form "first-name ...
Dan's user avatar
  • 32.9k
1 vote
0 answers
236 views

Is CEDET/semantic obsolete? How to analyze C code for source transformation tasks?

Reading through some CEDET docs I found that the author herself recommends "to use Semantic only as source of information, and perform names completion using other packages". Does this advice also ...
Vroomfondel's user avatar
3 votes
1 answer
1k views

Pretty print s expressions from the command line

I've got a file containing an emacs s-expression and I want to pretty print it from the command line: Is there an easy way of doing this? Paranoia suggests I want to do as little parsing of this data ...
Att Righ's user avatar
  • 775
1 vote
0 answers
78 views

How do I read and parse other Lisps in Emacs

I am playing with LFE language and I try to improve documentation lookup. Some of my efforts can be seen on my Github repo I have a function sexp-at-point which return a string enclosed by round ...
ruby_object's user avatar
2 votes
0 answers
64 views

Is it possible to detect C/C++/Java variable declarations.?

I'm writing a minor mode to handle automatic spacing of operator characters, but I'm having some trouble with C/C++. The problem is that I can't figure out how to tell in general whether a * is a ...
dshepherd's user avatar
  • 1,281
7 votes
0 answers
1k views

How do I parse a simple grammar and obtain a syntax tree in Emacs lisp?

How can I construct a parse tree from a string and a simple grammar? Semantic seems very tricky, and SMIE does not seem to produce a parse tree. Here's an example, assuming a language that looks like ...
Clément's user avatar
  • 3,985
8 votes
4 answers
1k views

How can I find surrounding parenthesis (from emacs lisp)?

Is there a way to find out the type of the surrounding parenthesis (i.e. '(', '[' or '{') around point? For example (using | to represent point) { abc, | df } should return '{', and { abc[ | ], ...
dshepherd's user avatar
  • 1,281
9 votes
2 answers
277 views

Make forward-sexp recognize blocks defined by keywords, not just parentheses

In a language (julia) that has blocks defined by keywords such as for..end, begin..end, as well as parentheses, what is a good way to skip over such a block? Also, end is not only a block keyword, but ...
Kirill's user avatar
  • 1,009
12 votes
2 answers
885 views

For what languages is `syntax-ppss` appropriate?

I've been looking at a way of detecting whether point is on a comment by looking at how the current buffer is fontified. Smartparens defines sp-point-in-comment, which relies on syntax-ppss. However, ...
Wilfred Hughes's user avatar
7 votes
2 answers
2k views

Elisp function to see a date for next Wednesday

Admitting up front that I am not capable of much Lisp, I have found ways to produce the current date or a number of seconds from a date, but I am looking for a simple equivalent to shell command like ...
David D.'s user avatar
  • 113