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
Copy file name to clipboardExpand all lines: README.md
+29-43Lines changed: 29 additions & 43 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,35 @@ Metafacture Fix (Metafix) is work in progress towards tools and an implementatio
109
109
110
110
See also [Fix Interest Group](https://github.com/elag/FIG) for an initiative towards an implementation-independent specification for the Fix Language.
111
111
112
-
The project `metafix` contains the actual implementation of the Fix language as a Metafacture module and related components. It started as an [Xtext](#xtext) web project with a Fix grammar, from which a parser, a web editor, and a language server are generated. This project also contains an extension for VS code/codium based on that language server. (The web editor has effectively been replaced by the [Metafacture Playground](https://metafacture.org/playground), but remains here for its integration into the language server, which [we want to move over](https://github.com/metafacture/metafacture-playground/issues?q=is%3Aissue+language+server+is%3Aopen) to the playground.)
112
+
The project `metafix` contains the actual implementation of the Fix language as a Metafacture module and related components. It started as an [Xtext](#xtext) web project with a Fix grammar, from which a parser, a web editor, and a language server are generated. This project also contains an extension for VS code/codium based on that language server. (The web editor has been replaced by the [Metafacture Playground](https://metafacture.org/playground).)
113
+
114
+
```
115
+
# Fix is a macro-language for data transformations
116
+
117
+
# Simple fixes
118
+
119
+
add_field("hello", "world")
120
+
remove_field("my.deep.nested.junk")
121
+
copy_field("stats", "output.$append")
122
+
123
+
# Conditionals
124
+
125
+
if exists("error")
126
+
set_field("is_valid", "no")
127
+
log("error")
128
+
elsif exists("warning")
129
+
set_field("is_valid", "yes")
130
+
log("warning")
131
+
else
132
+
set_field("is_valid", "yes")
133
+
end
134
+
135
+
# Loops
136
+
137
+
do list(path: "foo", "var": "$i")
138
+
add_field("$i.bar", "baz")
139
+
end
140
+
```
113
141
114
142
## Usage
115
143
@@ -147,48 +175,6 @@ vsce will create a vsix file in the vsc directory which can be used for installa
147
175
4. Click 'Extensions' section
148
176
5. Click menu bar and choose 'Install from VSIX...'
149
177
150
-
### Web editor
151
-
152
-
Start the web server:
153
-
154
-
`./gradlew jettyRun`
155
-
156
-
Visit [http://localhost:8080/](http://localhost:8080/), and paste this into the editor:
157
-
158
-
```
159
-
# Fix is a macro-language for data transformations
160
-
161
-
# Simple fixes
162
-
163
-
add_field("hello", "world")
164
-
remove_field("my.deep.nested.junk")
165
-
copy_field("stats", "output.$append")
166
-
167
-
# Conditionals
168
-
169
-
if exists("error")
170
-
set_field("is_valid", "no")
171
-
log("error")
172
-
elsif exists("warning")
173
-
set_field("is_valid", "yes")
174
-
log("warning")
175
-
else
176
-
set_field("is_valid", "yes")
177
-
end
178
-
179
-
# Loops
180
-
181
-
do list(path: "foo", "var": "$i")
182
-
add_field("$i.bar", "baz")
183
-
end
184
-
```
185
-
186
-
Content assist is triggered with Ctrl-Space. The input above is also used in `FixParsingTest.java`.
187
-
188
-
Run workflows on the web server, passing `data`, `flux`, and `fix`:
0 commit comments